package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

type point struct {
	x, y int
}

var ans int64

const (
	mod = int(1e9 + 7)
)

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	tt := 1
	//fmt.Fscanf(in, "%d\n", &tt)
	mod := int64(1e9 + 7)
	for ii := 0; ii < tt; ii++ {
		s := ""
		fmt.Fscanf(in, "%s\n", &s)
		n := len(s)
		f := make([]int64, n+4)
		f[0] = 1
		f[1] = 1
		f[2] = 2
		for i := 3; i <= n; i++ {
			f[i] = f[i-1] + f[i-2]
			f[i] %= mod
		}
		ans := int64(1)
		for len(s) > 0 {
			if s[0] == 'n' || s[0] == 'u' {
				cur := s[0]
				cnt := 0
				for len(s) > 0 && s[0] == cur {
					s = s[1:]
					cnt++
				}
				ans *= f[cnt]
				ans %= mod
			} else if s[0] == 'm' || s[0] == 'w' {
				ans = 0
				break
			} else {
				s = s[1:]
			}
		}
		fmt.Fprintf(out, "%d\n", ans)
	}
	return
}

func solve(n string) string {
	a := []int{}
	b := []int{}
	for i := 0; i < len(n); i++ {
		cur := int(n[i] - '0')
		if cur%2 == 0 {
			a = append(a, cur)
		} else {
			b = append(b, cur)
		}
	}
	ans := []byte{}
	for len(a)+len(b) > 0 {
		if len(a) == 0 {
			ans = append(ans, '0'+byte(b[0]))
			b = b[1:]
		} else if len(b) == 0 {
			ans = append(ans, '0'+byte(a[0]))
			a = a[1:]
		} else if a[0] < b[0] {
			ans = append(ans, '0'+byte(a[0]))
			a = a[1:]
		} else {
			ans = append(ans, '0'+byte(b[0]))
			b = b[1:]
		}
	}
	return string(ans)
}

func help(i int, n int, total int, t []int, g []int, cur int, c1, c2, c3 int, remaining int) {
	//fmt.Println(i, cur)
	if i == n {
		if cur == total {
			cal(c1, c2, c3)
		}
		return
	}
	if cur > total {
		return
	}
	if cur+remaining < total {
		return
	}
	switch g[i] {
	case 1:
		help(i+1, n, total, t, g, cur+t[i], c1+1, c2, c3, remaining-t[i])
	case 2:
		help(i+1, n, total, t, g, cur+t[i], c1, c2+1, c3, remaining-t[i])
	case 3:
		help(i+1, n, total, t, g, cur+t[i], c1, c2, c3+1, remaining-t[i])
	}
	help(i+1, n, total, t, g, cur, c1, c2, c3, remaining-t[i])
}

func cal(c1, c2, c3 int) {
	a := []int{c1, c2, c3}
	sort.Ints(a)
	tmp := int64(try(c1, c2, c3, 0))
	tmp %= int64(mod)
	for i := 1; i <= c1; i++ {
		tmp *= int64(i)
		tmp %= int64(mod)
	}
	for i := 1; i <= c2; i++ {
		tmp *= int64(i)
		tmp %= int64(mod)
	}
	for i := 1; i <= c3; i++ {
		tmp *= int64(i)
		tmp %= int64(mod)
	}
	ans += tmp
	ans %= int64(mod)
}

func try(a, b, c int, last int) int64 {
	if a == 0 && b == 0 && c == 0 {
		return 1
	}
	if a < 0 || b < 0 || c < 0 {
		return 0
	}
	if last == 0 {
		return try(a-1, b, c, 1) + try(a, b-1, c, 2) + try(a, b, c-1, 3)
	}
	if last == 1 {
		return try(a, b-1, c, 2) + try(a, b, c-1, 3)
	}
	if last == 2 {
		return try(a-1, b, c, 1) + try(a, b, c-1, 3)
	}
	return try(a-1, b, c, 1) + try(a, b-1, c, 2)
}

package main

import (
	"bufio"
	"bytes"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
)

func GetRW() (*bufio.Reader, *bufio.Writer) {
	l := os.Getenv("LOCAL_DEBUG")
	r := io.Reader(os.Stdin)
	w := io.Writer(os.Stdout)
	if l != "" {
		bs, _ := ioutil.ReadFile("in.txt")
		r = bytes.NewBuffer(bs)
	}
	return bufio.NewReader(r), bufio.NewWriter(w)
}

func main() {
	r, w := GetRW()
	defer w.Flush()
	var s string

	maxs := int64(100005)
	mod := int64(1000000007)
	preu := make([]int64, maxs)
	pren := make([]int64, maxs)

	preu[1] = 0
	pren[1] = 1

	for i := int64(2); i < maxs; i++ {
		preu[i] = pren[i-1]
		pren[i] = (pren[i-1] + preu[i-1]) % mod
	}

	for {
		if _, err := Fscanf(r, "%s\n", &s); err == io.EOF {
			break
		}
		f := false
		i := int64(0)
		t := make([]int64, 0)
		for {
			if i >= int64(len(s)) || f {
				break
			}
			if s[i] == 'u' || s[i] == 'n' {
				c := s[i]
				j := i + 1
				for j < int64(len(s)) && s[j] == c {
					j++
				}
				if j-i >= 2 {
					t = append(t, j-i)
				}
				i = j
			} else if s[i] == 'w' || s[i] == 'm' {
				f = true
			} else {
				i++
			}
		}
		if f {
			_, _ = Fprintf(w, "0\n")
		} else {
			res := int64(1)
			for _, v := range t {
				res = (((preu[v] + pren[v]) % mod) * res) % mod
			}
			_, _ = Fprintf(w, "%d\n", res)
		}
	}
}

package main

import (
	"bufio"
	"os"
	"runtime"
	"strconv"
)

/* solution */

var memo []int64

func solve() {

	memo = make([]int64, 2)
	memo[0], memo[1] = int64(0), int64(1)

	s := read()
	s = "Z" + s + "Z"

	ans := int64(1)

	last := byte('Z')
	cnt := 1
	for i := 0; i < len(s); i++ {
		if s[i] == 'w' || s[i] == 'm' {
			ans = 0
			break
		}
		if s[i] == 'u' && last == 'u' {
			cnt++
		} else if s[i] == 'n' && last == 'n' {
			cnt++
		} else if last == 'u' || last == 'n' {
			ans = (ans * fib(cnt+1)) % 1000000007
			cnt = 1
		}
		last = s[i]
	}

	printInt64(ans)

}

func fib(k int) int64 {

	for i := len(memo); i <= k; i++ {
		memo = append(memo, (memo[len(memo)-1]+memo[len(memo)-2])%1000000007)
	}

	return memo[k]

}

/* stubs */

func main() {

	var f *os.File
	if runtime.GOROOT() == "C:\\Soft\\Go" {
		f, _ = os.Open("input.txt")
		defer f.Close()
	} else {
		f = os.Stdin
	}

	writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	reader = bufio.NewScanner(f)

	const maxCapacity = 1024 * 1024
	buf := make([]byte, maxCapacity)
	reader.Buffer(buf, maxCapacity)

	reader.Split(bufio.ScanWords)

	solve()

}

var reader *bufio.Scanner
var writer *bufio.Writer

func read() string {
	reader.Scan()
	return reader.Text()
}

func readInt() int {
	reader.Scan()
	ret, _ := strconv.Atoi(reader.Text())
	return ret
}

func print(s string) {
	writer.WriteString(s)
	writer.WriteString("\n")
}

func printInt(i int) {
	print(strconv.Itoa(i))
}

func printInt64(i int64) {
	print(strconv.FormatInt(i, 10))
}

func readInt64() int64 {
	reader.Scan()
	ret, _ := strconv.ParseInt(reader.Text(), 10, 64)
	return ret
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

// Stupid hack to unexport constant
const MOD = 1000*1000*1000 + 7

func solve(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	s := ""
	fmt.Fscan(in, &s)
	n := len(s)
	dp := make([]int, n+1)
	dp[0] = 1
	for i := 1; i <= n; i++ {
		dp[i] = dp[i-1]
		if s[i-1] == 'm' || s[i-1] == 'w' {
			fmt.Fprintln(out, "0")
			return
		}
		if i > 1 && s[i-1] == s[i-2] && (s[i-1] == 'n' || s[i-1] == 'u') {
			dp[i] = (dp[i] + dp[i-2]) % MOD
		}
	}
	fmt.Fprintln(out, dp[n])
}

func main() {
	solve(os.Stdin, os.Stdout)
}

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		// str := strconv.FormatInt(A[i], 10)  // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var S []rune
var dp [100000 + 5][2]int64

func main() {
	S = ReadRuneSlice()
	n := len(S)

	for i := 0; i < n; i++ {
		if S[i] == 'm' || S[i] == 'w' {
			fmt.Println(0)
			return
		}
	}

	dp[0][0] = 1
	for i := 0; i < n; i++ {
		dp[i+1][0] += dp[i][0] + dp[i][1]
		dp[i+1][0] %= MOD

		if i == 0 {
			continue
		}

		if S[i] == 'u' && S[i-1] == 'u' {
			dp[i+1][1] += dp[i][0]
			dp[i+1][1] %= MOD
		} else if S[i] == 'n' && S[i-1] == 'n' {
			dp[i+1][1] += dp[i][0]
			dp[i+1][1] %= MOD
		}
	}

	ans := dp[n][0] + dp[n][1]
	ans %= MOD
	fmt.Println(ans)
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func solve(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	const mod int64 = 1e9 + 7

	var s string
	Fscan(in, &s)
	n := len(s)

	f := make([]int64, n+10)
	f[0] = 1
	f[1] = 1
	for i := 2; i <= n; i++ {
		f[i] = (f[i-1] + f[i-2]) % mod
	}

	ans := int64(1)
	for i := 0; i < n; {
		if s[i] == 'm' || s[i] == 'w' {
			Fprintln(out, 0)
			return
		}
		if s[i] == 'n' {
			j := i + 1
			for ; j < n; j++ {
				if s[j] != 'n' {
					break
				}
			}
			cnt := j - i
			ans = ans * f[cnt] % mod
			i = j
		} else if s[i] == 'u' {
			j := i + 1
			for ; j < n; j++ {
				if s[j] != 'u' {
					break
				}
			}
			cnt := j - i
			ans = ans * f[cnt] % mod
			i = j

		} else {
			i++
		}
	}
	Fprintln(out, ans)
}

func main() {
	solve(os.Stdin, os.Stdout)
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

// w =>> uu
// m =>> nn
const MOD = 1000000007

func main() {
	defer out.Flush()
	s := ScanWord()
	P(solv(s))
}

func solv(s string) int {
	if s[0] == 'm' || s[0] == 'w' {
		return 0
	}
	if len(s) > 1 && (s[0] == 'm' || s[1] == 'w') {
		return 0
	}
	dp := make([]int, len(s)+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= len(s); i++ {
		if s[i-1] == 'm' || s[i-1] == 'w' {
			return 0
		}

		dp[i] = dp[i-1]
		if (s[i-1] == 'n' && s[i-2] == 'n') || (s[i-1] == 'u' && s[i-2] == 'u') {
			dp[i] = (dp[i-2] + dp[i]) % MOD
		}
	}
	return dp[len(s)]
}

/*********************** I/O ***********************/
var in *bufio.Scanner
var out *bufio.Writer

func init() {
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)
	out = bufio.NewWriter(os.Stdout)
}

func P(args ...interface{}) {
	print("\n", args...)
}

func PS(args ...interface{}) {
	print(" ", args...)
	print("\n", nil)
}

func print(seperator string, args ...interface{}) {
	for _, arg := range args {
		str := ""
		switch v := arg.(type) {
		case byte:
			str = string(v)
		case rune:
			str = string(v)
		case int:
			str = strconv.Itoa(v)
		case []int:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.Itoa(v[i]) + " ")
			}
			str = sb.String()
		case int64:
			str = strconv.FormatInt(v, 10)
		case []int64:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.FormatInt(v[i], 10) + " ")
			}
			str = sb.String()
		case string:
			str = v
		default:
			panic("invalid print arg: " + fmt.Sprintf("%v", arg))

		}
		out.WriteString(str + seperator)
	}
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanWords(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = ScanInt()
	}
	return a
}

func MnMx(args ...int) (int, int) {
	minVal, maxVal := math.MaxInt32, math.MinInt32
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int) int { mn, _ := MnMx(args...); return mn }
func Mx(args ...int) int { _, mx := MnMx(args...); return mx }
func LCM(a, b int) int   { return a / GCD(a, b) * b }
func GCD(a, b int) int {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

// w =>> uu
// m =>> nn
const MOD = 1000000007

func main() {
	defer out.Flush()
	s := ScanWord()
	P(solv(s))
}

func solv(s string) int {
	if s[0] == 'm' || s[0] == 'w' {
		return 0
	}
	if len(s) > 1 && (s[0] == 'm' || s[1] == 'w') {
		return 0
	}
	dp := make([]int, len(s)+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= len(s); i++ {
		if s[i-1] == 'm' || s[i-1] == 'w' {
			return 0
		}
		if (s[i-1] == 'n' && s[i-2] == 'n') || (s[i-1] == 'u' && s[i-2] == 'u') {
			dp[i] = (dp[i-2] + dp[i-1]) % MOD
		} else {
			dp[i] = dp[i-1]
		}
	}
	return dp[len(s)]
}

/*********************** I/O ***********************/
var in *bufio.Scanner
var out *bufio.Writer

func init() {
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)
	out = bufio.NewWriter(os.Stdout)
}

func P(args ...interface{}) {
	print("\n", args...)
}

func PS(args ...interface{}) {
	print(" ", args...)
	print("\n", nil)
}

func print(seperator string, args ...interface{}) {
	for _, arg := range args {
		str := ""
		switch v := arg.(type) {
		case byte:
			str = string(v)
		case rune:
			str = string(v)
		case int:
			str = strconv.Itoa(v)
		case []int:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.Itoa(v[i]) + " ")
			}
			str = sb.String()
		case int64:
			str = strconv.FormatInt(v, 10)
		case []int64:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.FormatInt(v[i], 10) + " ")
			}
			str = sb.String()
		case string:
			str = v
		default:
			panic("invalid print arg: " + fmt.Sprintf("%v", arg))

		}
		out.WriteString(str + seperator)
	}
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanWords(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = ScanInt()
	}
	return a
}

func MnMx(args ...int) (int, int) {
	minVal, maxVal := math.MaxInt32, math.MinInt32
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int) int { mn, _ := MnMx(args...); return mn }
func Mx(args ...int) int { _, mx := MnMx(args...); return mx }
func LCM(a, b int) int   { return a / GCD(a, b) * b }
func GCD(a, b int) int {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

const N = 100010
const mod  = 1000000007
var dp[N] int

func main()  {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var s string
	fmt.Fscanf(reader, "%s", &s)
	var have = false
	for _, c := range s{
		if c == 'm' || c == 'w' {
			have = true
		}
	}

	if have {
		fmt.Fprintf(writer, "0")
		return
	}

	var n = len(s)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= n; i++ {
		dp[i] = dp[i - 1]
		if s[i - 1] == 'u' && s[i - 1] == s[i - 2] {
			dp[i] += dp[i - 2]
			dp[i] %= mod
		}

		if s[i - 1] == 'n' && s[i - 1] == s[i - 2] {
			dp[i] += dp[i - 2]
			dp[i] %= mod
		}
	}

	fmt.Fprintf(writer, "%d\n", dp[n])
}

package main

import (
	"fmt"
	s "strings"
)

var str string

var count int = 1

const MOD = 1000000007
func main() {
	fmt.Scanf("%s", &str)
	if s.Contains(str, "m") || s.Contains(str, "w") {
		fmt.Printf("%d", 0)
		return
	}

	var dp [100001]int
	dp[0] = 1
	if len(str) == 1 {
		fmt.Printf("%d", 1)
		return
	}
	dp[1] = 1
	if str[1] == 'n' && str[0] == 'n' || str[1] == 'u' && str[0] == 'u' {
		dp[1] = 2
	}

	i := 2

	for ; i < len(str); i++ {
		if str[i] == str[i-1] && str[i] == 'n' || str[i] == str[i-1] && str[i] == 'u' {
			dp[i] = (dp[i-1] + dp[i-2]) % MOD
		} else {
			dp[i] = dp[i-1] % MOD
		}
	}
	fmt.Printf("%d", dp[len(str)-1])
}

package main

import (
	"fmt"

)

import s "strings"

var str string

var count int = 1

func main() {
	fmt.Scanf("%s", &str)
	if s.Contains(str, "m") || s.Contains(str, "w"){
		print(0)
		return
	}

	var dp [10001]int
	dp[0] = 1
	dp[1] = 1
	if str[1] == 'n' && str[0] == 'n' || str[1] == 'u' && str[0] == 'u'{
		dp[1] = 2
	}

	i:= 2

	for ; i<len(str);i++ {
		if str[i] == str[i-1] && str[i] == 'n' || str[i] == str[i-1] && str[i] == 'u'{
			dp[i] = dp[i-1] + dp[i-2]
		}else{
			dp[i] = dp[i-1]
		}
	}
	println(dp[len(str)-1])
}

package main

import (
	"fmt"

)

import s "strings"

var str string

var count int = 1

func main() {
	fmt.Scanf("%s", &str)
	if s.Contains(str, "m") || s.Contains(str, "w"){
		print(0)
		return
	}

	var dp [10001]int
	dp[0] = 1
	dp[1] = 1
	if str[1] == 'n' && str[0] == 'n' || str[1] == 'u' && str[0] == 'u'{
		dp[1] = 2
	}

	i:= 2

	for ; i<len(str);i++ {
		if str[i] == str[i-1] && str[i] == 'n' || str[i] == str[i-1] && str[i] == 'u'{
			dp[i] = dp[i-1] + dp[i-2]
		}else{
			dp[i] = dp[i-1]
		}
	}
	fmt.Printf("%d", dp[len(str)-1])
}

package main

import (
	"fmt"

)

import s "strings"

var str string

var count int = 1

func main() {
	fmt.Scanf("%s", &str)
	if s.Contains(str, "m") || s.Contains(str, "w"){
		print(0)
		return
	}

	var dp [10001]int
	dp[0] = 1
	dp[1] = 1
	if str[1] == 'n' && str[0] == 'n' || str[1] == 'u' && str[0] == 'u'{
		dp[1] = 2
	}

	i:= 2

	for ; i<len(str);i++ {
		if str[i] == str[i-1] && str[i] == 'n' || str[i] == str[i-1] && str[i] == 'u'{
			dp[i] = dp[i-1] + dp[i-2]
		}else{
			dp[i] = dp[i-1]
		}
	}
	print(dp[len(str)-1])
}

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func init() {
	ReadString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	// Split sets the split function for the Scanner. The default split function is ScanLines.
	// Split panics if it is called after scanning has started.
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

/*********** DP sub-functions ***********/

// ChMin accepts a pointer of integer and a target value.
// If target value is SMALLER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMin(updatedValue *int, target int) bool {
	if *updatedValue > target {
		*updatedValue = target
		return true
	}
	return false
}

// ChMax accepts a pointer of integer and a target value.
// If target value is LARGER than the first argument,
//	then the first argument will be updated by the second argument.
func ChMax(updatedValue *int, target int) bool {
	if *updatedValue < target {
		*updatedValue = target
		return true
	}
	return false
}

// NthBit returns nth bit value of an argument.
// n starts from 0.
func NthBit(num, nth int) int {
	return num >> uint(nth) & 1
}

// OnBit returns the integer that has nth ON bit.
// If an argument has nth ON bit, OnBit returns the argument.
func OnBit(num, nth int) int {
	return num | (1 << uint(nth))
}

// OffBit returns the integer that has nth OFF bit.
// If an argument has nth OFF bit, OffBit returns the argument.
func OffBit(num, nth int) int {
	return num & ^(1 << uint(nth))
}

// PopCount returns the number of ON bit of an argument.
func PopCount(num int) int {
	res := 0

	for i := 0; i < 70; i++ {
		if ((num >> uint(i)) & 1) == 1 {
			res++
		}
	}

	return res
}

/*********** Arithmetic ***********/

// Max returns the max integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Max(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m < integer {
			m = integer
		}
	}
	return m
}

// Min returns the min integer among input set.
// This function needs at least 1 argument (no argument causes panic).
func Min(integers ...int) int {
	m := integers[0]
	for i, integer := range integers {
		if i == 0 {
			continue
		}
		if m > integer {
			m = integer
		}
	}
	return m
}

// Sum returns multiple integers sum.
func Sum(integers ...int) int {
	s := 0

	for _, i := range integers {
		s += i
	}

	return s
}

// PowInt is integer version of math.Pow
// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).
func PowInt(a, e int) int {
	if a < 0 || e < 0 {
		panic(errors.New("[argument error]: PowInt does not accept negative integers"))
	}

	if e == 0 {
		return 1
	}

	if e%2 == 0 {
		halfE := e / 2
		half := PowInt(a, halfE)
		return half * half
	}

	return a * PowInt(a, e-1)
}

// AbsInt is integer version of math.Abs
func AbsInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// Gcd returns the Greatest Common Divisor of two natural numbers.
// Gcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Gcd uses the Euclidean Algorithm.
func Gcd(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}
	if a < b {
		a, b = b, a
	}

	// Euclidean Algorithm
	for b > 0 {
		div := a % b
		a, b = b, div
	}

	return a
}

// Lcm returns the Least Common Multiple of two natural numbers.
// Lcd only accepts two natural numbers (a, b >= 1).
// 0 or negative number causes panic.
// Lcd uses the Euclidean Algorithm indirectly.
func Lcm(a, b int) int {
	if a <= 0 || b <= 0 {
		panic(errors.New("[argument error]: Gcd only accepts two NATURAL numbers"))
	}

	// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2
	// a' and b' are relatively prime numbers
	// gcd consists of prime numbers, that are included in a and b
	gcd := Gcd(a, b)

	// not (a * b / gcd), because of reducing a probability of overflow
	return (a / gcd) * b
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		// str := strconv.FormatInt(A[i], 10)  // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const MOD = 1000000000 + 7
const ALPHABET_NUM = 26
const INF_INT64 = math.MaxInt64
const INF_BIT60 = 1 << 60

var S []rune
var dp [100000 + 5][2]int64

func main() {
	S = ReadRuneSlice()
	n := len(S)

	for i := 0; i < n; i++ {
		if S[i] == 'm' || S[i] == 'w' {
			fmt.Println(0)
			return
		}
	}

	dp[0][0] = 1
	for i := 0; i < n; i++ {
		dp[i+1][0] += dp[i][0] + dp[i][1]
		dp[i+1][0] %= MOD

		if i == 0 {
			continue
		}

		if S[i] == 'u' && S[i-1] == 'u' {
			dp[i+1][1] += dp[i][0]
			dp[i+1][1] %= MOD
		} else if S[i] == 'n' && S[i-1] == 'n' {
			dp[i+1][1] += dp[i][0]
			dp[i+1][1] %= MOD
		}
	}

	fmt.Println(dp[n][0] + dp[n][1])
}

// MODはとったか？
// 遷移だけじゃなくて最後の最後でちゃんと取れよ？

/*******************************************************************/

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func solve(reader io.Reader, writer io.Writer) {
	in := bufio.NewReader(reader)
	out := bufio.NewWriter(writer)
	defer out.Flush()

	const mod int64 = 1e9+7

	var s string
	Fscan(in, &s)
	n := len(s)

	f := make([]int64, n+10)
	f[1] = 1
	for i := 2;i<=n;i++ {
		f[n]=(f[n-1]+f[n-2]) %mod
	}

	ans := int64(1)
	for i := 0; i < n; {
		if s[i] == 'm' || s[i] == 'w' {
			Fprintln(out, 0)
			return
		}
		if s[i] == 'n' {
			j := i+1
			for ;j<n;j++ {
				if s[j] !='n' {
					break
				}
			}
			cnt := j-i
			ans =ans*int64(cnt)%mod
			i = j
		} else if s[i] == 'u' {
			j := i+1
			for ;j<n;j++ {
				if s[j] !='u' {
					break
				}
			}
			cnt := j-i
			ans =ans*int64(cnt)%mod
			i = j

		} else {
			i++
		}
	}
	Fprintln(out, ans)
}

func main() {
	solve(os.Stdin, os.Stdout)
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

// w =>> uu
// m =>> nn
const MOD = 1000000007

func main() {
	defer out.Flush()
	s := ScanWord()
	P(solv(s))
}

func solv(s string) int {
	if s[0] == 'm' || s[0] == 'w' {
		return 0
	}

	dp := make([]int, len(s)+1)
	dp[0] = 1
	for i := 1; i < len(s); i++ {
		if s[i] == 'm' || s[i] == 'w' {
			return 0
		} else if s[i] == 'n' && s[i-1] == 'n' {
			dp[i] = (dp[i-1] * 2) % MOD
		} else if s[i] == 'u' && s[i-1] == 'u' {
			dp[i] = (dp[i-1] * 2) % MOD
		} else {
			dp[i] = dp[i-1]
		}
	}
	return dp[len(s)-1]
}

/*********************** I/O ***********************/
var in *bufio.Scanner
var out *bufio.Writer

func init() {
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)
	out = bufio.NewWriter(os.Stdout)
}

func P(args ...interface{}) {
	print("\n", args...)
}

func PS(args ...interface{}) {
	print(" ", args...)
	print("\n", nil)
}

func print(seperator string, args ...interface{}) {
	for _, arg := range args {
		str := ""
		switch v := arg.(type) {
		case byte:
			str = string(v)
		case rune:
			str = string(v)
		case int:
			str = strconv.Itoa(v)
		case []int:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.Itoa(v[i]) + " ")
			}
			str = sb.String()
		case int64:
			str = strconv.FormatInt(v, 10)
		case []int64:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.FormatInt(v[i], 10) + " ")
			}
			str = sb.String()
		case string:
			str = v
		default:
			panic("invalid print arg: " + fmt.Sprintf("%v", arg))

		}
		out.WriteString(str + seperator)
	}
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanWords(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = ScanInt()
	}
	return a
}

func MnMx(args ...int) (int, int) {
	minVal, maxVal := math.MaxInt32, math.MinInt32
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int) int { mn, _ := MnMx(args...); return mn }
func Mx(args ...int) int { _, mx := MnMx(args...); return mx }
func LCM(a, b int) int   { return a / GCD(a, b) * b }
func GCD(a, b int) int {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

// w =>> uu
// m =>> nn
const MOD = 1000000007

func main() {
	defer out.Flush()
	s := ScanWord()
	P(solv(s))
}

func solv(s string) int {
	dp := make([]int, len(s)+1)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= len(s); i++ {
		if s[i-1] == 'm' || s[i-1] == 'w' {
			return 0
		}
		if (s[i-1] == 'n' && s[i-2] == 'n') || (s[i-1] == 'u' && s[i-2] == 'u') {
			dp[i] = (dp[i-2] + dp[i-1]) % MOD
		} else {
			dp[i] = dp[i-1]
		}
	}
	return dp[len(s)]
}

/*********************** I/O ***********************/
var in *bufio.Scanner
var out *bufio.Writer

func init() {
	in = bufio.NewScanner(os.Stdin)
	in.Buffer(make([]byte, 1024), int(1e+9))
	in.Split(bufio.ScanWords)
	out = bufio.NewWriter(os.Stdout)
}

func P(args ...interface{}) {
	print("\n", args...)
}

func PS(args ...interface{}) {
	print(" ", args...)
	print("\n", nil)
}

func print(seperator string, args ...interface{}) {
	for _, arg := range args {
		str := ""
		switch v := arg.(type) {
		case byte:
			str = string(v)
		case rune:
			str = string(v)
		case int:
			str = strconv.Itoa(v)
		case []int:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.Itoa(v[i]) + " ")
			}
			str = sb.String()
		case int64:
			str = strconv.FormatInt(v, 10)
		case []int64:
			sb := strings.Builder{}
			for i := 0; i < len(v); i++ {
				sb.WriteString(strconv.FormatInt(v[i], 10) + " ")
			}
			str = sb.String()
		case string:
			str = v
		default:
			panic("invalid print arg: " + fmt.Sprintf("%v", arg))

		}
		out.WriteString(str + seperator)
	}
}

func ScanWord() string { in.Scan(); return in.Text() }
func ScanWords(n int) []string {
	s := make([]string, n)
	for i := 0; i < n; i++ {
		s[i] = ScanWord()
	}
	return s
}
func ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }
func ScanInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = ScanInt()
	}
	return a
}

func MnMx(args ...int) (int, int) {
	minVal, maxVal := math.MaxInt32, math.MinInt32
	for _, v := range args {
		if v < minVal {
			minVal = v
		}
		if v > maxVal {
			maxVal = v
		}
	}
	return minVal, maxVal
}
func Mn(args ...int) int { mn, _ := MnMx(args...); return mn }
func Mx(args ...int) int { _, mx := MnMx(args...); return mx }
func LCM(a, b int) int   { return a / GCD(a, b) * b }
func GCD(a, b int) int {
	if a == 0 {
		return b
	}
	return GCD(b%a, a)
}
func Abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

const N = 100010
const mod  = 1000000007
var dp[N] int

func main()  {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	var s string
	fmt.Fscanf(reader, "%s", &s)
	var n = len(s)
	dp[0] = 1
	dp[1] = 1
	for i := 2; i <= n; i++ {
		dp[i] = dp[i - 1]
		if s[i - 1] == 'u' && s[i - 1] == s[i - 2] {
			dp[i] += dp[i - 2]
			dp[i] %= mod
		}

		if s[i - 1] == 'n' && s[i - 1] == s[i - 2] {
			dp[i] += dp[i - 2]
			dp[i] %= mod
		}
	}

	fmt.Fprintf(writer, "%d\n", dp[n])
}


package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

var _, _, _ = main, rw, do

func main() {
	r, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)
	defer w.Flush()
	rw(r, w)
}

func rw(r io.Reader, w io.Writer) {
	var t int
	var s string
	fmt.Fscan(r, &t)
	for ti := 0; ti < t; ti++ {
		fmt.Fscan(r, &s)
		w1, w2, w3 := do(s)
		if w3 {
			fmt.Fprint(w, w1, " ", w2)
		} else {
			fmt.Fprint(w, -1)
		}
		fmt.Fprintln(w)
	}
}

func do(t string) (string, string, bool) {
	m := map[byte]int{}
	var d string
	for i := len(t) - 1; i >= 0; i-- {
		m[t[i]]++
		if m[t[i]] == 1 {
			d = string(t[i]) + d
		}
	}
	l := 0
	for i := range d {
		if m[d[i]]%(i+1) != 0 {
			return "", "", false
		}
		l += m[d[i]] / (i + 1)
	}
	s := t[:l]
	a := 0
	b := l
	for i := range d {
		l -= (m[d[i]] / (i + 1))
		c := b + l
		if !chk(t[a:b], t[b:c], d[i]) {
			return "", "", false
		}
		a, b = b, c
	}
	return s, d, true
}

func chk(a, b string, c byte) bool {
	var i, j int
	for i < len(a) && j < len(b) {
		if a[i] == c {
			i++
			continue
		}
		if a[i] != b[j] {
			return false
		}
		i++
		j++
	}
	for i < len(a) && a[i] == c {
		i++
	}
	return i >= len(a) && j >= len(b)
}

package main

import (
	"bufio"
	"os"
	"fmt"
	"bytes"
)

func main() {

	r := bufio.NewReader(os.Stdin)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var str string
		fmt.Fscan(r, &str)

		r, a, b := solve(str)

		if r {
			fmt.Print(a)
			fmt.Print(" ")
			fmt.Print(b)
			fmt.Println()
		} else {
			fmt.Println("-1")
		}
	}
}

func solve(t string) (bool, string, string) {
	//abcdbabccbd - a = bcdbbccbd

	//abcdbabccbdbcdbbccbd - b = cdccd
	//abcdbabccbdbcdbbccbdcdccd - c = dd
	//abcdbabccbdbcdbbccbdcdccddd - d = ""
	//abcdbabccbdbcdbbccbdcdccddd

 	mp := make(map[byte]int)

 	seen := make([]bool, 27)
 	var order []byte

 	for i := len(t) - 1; i >= 0; i-- {
 		mp[t[i]]++
 		if seen[t[i] - 'a'] {
 			continue
		}
		seen[t[i] - 'a'] = true
		order = append(order, t[i])
	}

	most := order[0]
	//appr := math.Sqrt(float64(mp[most]))
	count := mp[most]

	for i := 1; i <= mp[most]; i++ {
		if count % i != 0 {
			continue
		}
		d := count/i

		if d > len(order) {
			continue
		}

		ok := true

		for j := 1; j < len(order); j++ {

			if d == 1 {
				ok = false
				break
			}

			letter := order[j]
			fr := mp[letter]

			if fr % (d - 1) != 0 {
				ok = false
				break
			}
			d--
		}

		if ok {
			temp := count/i
			counts := make(map[byte]int)
			counts[order[0]] = i
			temp--

			for i := 1; i < len(order); i++ {
				c := mp[order[i]]/temp
				counts[order[i]] = c

				temp--
			}

			var in bytes.Buffer

			good := true

			var i int
			for i = 0; i < len(t); i++ {
				if counts[t[i]] <= 0 {
					for _, v := range counts {
						if v > 0 {
							good = false
							break
						}
					}
					break
				}

				in.WriteByte(t[i])
				counts[t[i]]--
			}

			if !good {
				continue
			}

			str := in.String()

			var tot bytes.Buffer
			tot.WriteString(str)

			seen := make([]bool, 27)

			for i := len(order) - 1; i >= 0; i-- {
				seen[order[i] - 'a']= true

				for k := 0; k < len(str); k++ {
					if seen[str[k] - 'a'] {
						continue
					}
					tot.WriteByte(str[k])
				}
			}

			if t == tot.String() {

				var o bytes.Buffer
				for i := len(order) - 1; i >= 0; i--{
					o.WriteByte(order[i])
				}

				return true, str, o.String()
			}
		}
	}

	return false, "", ""
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

package main

import (
	"bufio"
	"bytes"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1560E(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T int
	var t []byte
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &t)
		n := len(t)
		del := []byte{}
		vis := 0
		for i := n - 1; i >= 0; i-- {
			if b := t[i]; 1<<(b-'a')&vis == 0 {
				vis |= 1 << (b - 'a')
				del = append(del, b)
			}
		}
		m := len(del)
		for i := 0; i < m/2; i++ {
			del[i], del[m-1-i] = del[m-1-i], del[i]
		}
		p := bytes.LastIndexByte(t, del[0]) + 1
		ex := 0
		for i := 1; i < m; i++ {
			ex += i * bytes.Count(t[:p], del[i:i+1])
		}
		for ; p+ex < n; p++ {
			ex += bytes.IndexByte(del, t[p])
		}
		if p+ex > n {
			Fprintln(out, -1)
			continue
		}
		s := t[:p]
		t2 := make([]byte, 0, n)
		t2 = append(t2, s...)
		for i := range del {
			s = bytes.ReplaceAll(s, del[i:i+1], nil)
			t2 = append(t2, s...)
		}
		if bytes.Compare(t2, t) != 0 {
			Fprintln(out, -1)
		} else {
			Fprintf(out, "%s %s\n", t[:p], del)
		}
	}
}

func main() { CF1560E(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	in := NewIn()
	out := NewOut()
	defer out.flush()

	run(in, out)
}

func run(in *In, out *Out) {
	cases(in, out)
	// solve(in, out)
}

/* --- Solution E --- */
func solve(in *In, out *Out) {
	s := in.next()
	n := len(s)

	var decrypt func() (string, []byte)
	decrypt = func() (string, []byte) {
		freq := map[byte]int{}
		revOrder := []byte{}

		for i := n - 1; i > -1; i-- {
			if freq[s[i]] == 0 {
				revOrder = append(revOrder, s[i])
			}
			freq[s[i]]++
		}

		k := len(revOrder)
		origLen := 0
		for i := 0; i < k; i++ {
			origLen += freq[revOrder[i]] / (k - i)
		}

		return s[:origLen], revOrder
	}

	var encrypt func(string, []byte) string
	encrypt = func(orig string, revOrder []byte) string {
		res := []byte(orig)
		for i := len(revOrder) - 1; i > -1; i-- {
			temp := []byte{}
			for j := 0; j < len(orig); j++ {
				if orig[j] != revOrder[i] {
					res = append(res, orig[j])
					temp = append(temp, orig[j])
				}
			}
			orig = string(temp)
		}
		return string(res)
	}

	orig, revOrder := decrypt()
	if encrypt(orig, revOrder) != s {
		out.println(-1)
	} else {
		out.printf("%s ", orig)
		for i := len(revOrder) - 1; i > -1; i-- {
			out.printf("%c", revOrder[i])
		}
		out.println()
	}

}

func cases(in *In, out *Out) {
	t := in.nextInt()
	for ; t > 0; t-- {
		solve(in, out)
	}
}

/* --- I/O --- */
const BUF_MAX_CAP int = 1e7

type In struct {
	scanner *bufio.Scanner
}

func NewIn() *In {
	scn := bufio.NewScanner(os.Stdin)

	buf := make([]byte, BUF_MAX_CAP)
	scn.Buffer(buf, BUF_MAX_CAP)
	scn.Split(bufio.ScanWords)

	return &In{scn}
}

func (in *In) nextInt() int {
	in.scanner.Scan()
	i, _ := strconv.Atoi(in.scanner.Text())
	return i
}

func (in *In) nextLong() int64 {
	in.scanner.Scan()
	i, _ := strconv.ParseInt(in.scanner.Text(), 10, 64)
	return i
}

func (in *In) nextDouble() float64 {
	in.scanner.Scan()
	i, _ := strconv.ParseFloat(in.scanner.Text(), 64)
	return i
}

func (in *In) next() string {
	in.scanner.Scan()
	return in.scanner.Text()
}

type Out struct {
	writer *bufio.Writer
}

func NewOut() *Out {
	out := Out{bufio.NewWriter(os.Stdout)}
	return &out
}

func (out *Out) println(a ...interface{}) {
	fmt.Fprintln(out.writer, a...)
}

func (out *Out) printf(format string, a ...interface{}) {
	fmt.Fprintf(out.writer, format, a...)
}

func (out *Out) print(a ...interface{}) {
	fmt.Fprint(out.writer, a...)
}

func (out *Out) flush() {
	out.writer.Flush()
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	var t int
	in := bufio.NewReader(os.Stdin)
	out := os.Stdout
	fmt.Fscan(in,&t)
	for u:=1;u<=t;u++{
		var s []byte
		fmt.Fscan(in,&s)
		mp := map[byte]int{}
		cool := []byte{}
		for i:=len(s)-1;i>=0;i--{
			if mp[s[i]]==0{
				mp[s[i]]=1
				cool = append([]byte{s[i]},cool...)
			}
		}
		cnt := map[byte]int{}
		for i:=0;i<len(s);i++{
			cnt[s[i]]++
		}
		flag := true
		word := map[byte]int{}
		for i:=0;i<len(cool);i++{
			x := i+1
			if cnt[cool[i]]%x!=0{
				flag = false
				break
			}
			word[cool[i]]=cnt[cool[i]]/x
		}
		if !flag{
			fmt.Fprintln(out,-1)
			continue
		}
		ret := []byte{}
		for i:=0;i<len(s);i++{
			word[s[i]]--
			ret = append(ret,s[i])
			check:=false
			for _,v :=range word{
				if v!=0{
					check=true
				}
			}
			if !check{
				break
			}
		}
		sb := string(ret)
		dis := 0
		good := true
		for i:=0;i<len(cool);i++{
			l := strings.Split(sb,string(cool[i]))
			temp := ""
			for j:=0;j<len(l);j++{
				temp = temp + l[j]
			}
			if len(sb)+dis+len(temp)>len(s)||strings.Compare(string(s[(len(sb)+dis):(len(sb)+dis)+len(temp)]),temp)!=0{
				good = false
				break
			}
			dis += len(sb)
			sb = temp
		}
		if !good{
			fmt.Fprintln(out,-1)
		}else{
			fmt.Fprintf(out,"%s %s\n",string(ret),string(cool))
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	var t int
	in := bufio.NewReader(os.Stdin)
	out := os.Stdout
	fmt.Fscan(in,&t)
	for u:=1;u<=t;u++{
		var s []byte
		fmt.Fscan(in,&s)
		mp := map[byte]int{}
		cool := []byte{}
		for i:=len(s)-1;i>=0;i--{
			if mp[s[i]]==0{
				mp[s[i]]=1
				cool = append([]byte{s[i]},cool...)
			}
		}
		cnt := map[byte]int{}
		for i:=0;i<len(s);i++{
			cnt[s[i]]++
		}
		flag := true
		word := map[byte]int{}
		for i:=0;i<len(cool);i++{
			x := i+1
			if cnt[cool[i]]%x!=0{
				flag = false
				break
			}
			word[cool[i]]=cnt[cool[i]]/x
		}
		if !flag{
			fmt.Fprintln(out,-1)
			continue
		}
		ret := []byte{}
		for i:=0;i<len(s);i++{
			word[s[i]]--
			ret = append(ret,s[i])
			check:=false
			for _,v :=range word{
				if v!=0{
					check=true
				}
			}
			if !check{
				break
			}
		}
		sb := string(ret)
		dis := 0
		good := true
		for i:=0;i<len(cool);i++{
			l := strings.Split(sb,string(cool[i]))
			temp := ""
			for j:=0;j<len(l);j++{
				temp = temp + l[j]
			}
			fmt.Println(temp)
			if len(sb)+dis+len(temp)>len(s)||strings.Compare(string(s[(len(sb)+dis):(len(sb)+dis)+len(temp)]),temp)!=0{
				good = false
				break
			}
			dis += len(sb)
			sb = temp
		}
		if !good{
			fmt.Fprintln(out,-1)
		}else{
			fmt.Fprintf(out,"%s %s\n",string(ret),string(cool))
		}
	}
}

package main

import (
	"bufio"
	"os"
	"fmt"
	"math"
	"bytes"
)

func main() {

	r := bufio.NewReader(os.Stdin)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		var str string
		fmt.Fscan(r, &str)

		r, a, b := solve(str)

		if r {
			fmt.Print(a)
			fmt.Print(" ")
			fmt.Print(b)
			fmt.Println()
		} else {
			fmt.Println("-1")
		}
	}
}

func solve(t string) (bool, string, string) {
	//abcdbabccbd - a = bcdbbccbd

	//abcdbabccbdbcdbbccbd - b = cdccd
	//abcdbabccbdbcdbbccbdcdccd - c = dd
	//abcdbabccbdbcdbbccbdcdccddd - d = ""
	//abcdbabccbdbcdbbccbdcdccddd

 	mp := make(map[byte]int)

 	seen := make([]bool, 27)
 	var order []byte

 	for i := len(t) - 1; i >= 0; i-- {
 		mp[t[i]]++
 		if seen[t[i] - 'a'] {
 			continue
		}
		seen[t[i] - 'a'] = true
		order = append(order, t[i])
	}

	most := order[0]
	appr := math.Sqrt(float64(mp[most]))
	count := mp[most]

	for i := 1; i < int(appr) + 10; i++ {
		if count % i != 0 {
			continue
		}
		d := count/i

		if d > len(order) {
			continue
		}

		ok := true

		for j := 1; j < len(order); j++ {

			if d == 1 {
				ok = false
				break
			}

			letter := order[j]
			fr := mp[letter]

			if fr % (d - 1) != 0 {
				ok = false
				break
			}
			d--
		}

		if ok {
			temp := count/i
			counts := make(map[byte]int)
			counts[order[0]] = i
			temp--

			for i := 1; i < len(order); i++ {
				c := mp[order[i]]/temp
				counts[order[i]] = c

				temp--
			}

			var in bytes.Buffer

			good := true

			var i int
			for i = 0; i < len(t); i++ {
				if counts[t[i]] <= 0 {
					for _, v := range counts {
						if v > 0 {
							good = false
							break
						}
					}
					break
				}

				in.WriteByte(t[i])
				counts[t[i]]--
			}

			if !good {
				continue
			}

			str := in.String()

			var tot bytes.Buffer
			tot.WriteString(str)

			seen := make([]bool, 27)

			for i := len(order) - 1; i >= 0; i-- {
				seen[order[i] - 'a']= true

				for k := 0; k < len(str); k++ {
					if seen[str[k] - 'a'] {
						continue
					}
					tot.WriteByte(str[k])
				}
			}

			if t == tot.String() {

				var o bytes.Buffer
				for i := len(order) - 1; i >= 0; i--{
					o.WriteByte(order[i])
				}

				return true, str, o.String()
			}
		}
	}

	return false, "", ""
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

type CF1608B struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1608B) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1608B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1608B) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1608B) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1608B) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1608B
Date: 11/12/21
User: epradere
URL: https://codeforces.com/contest/1608/problem/B
Problem: CF1608B
**/
func (in *CF1608B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n, a, b := in.NextInt(), in.NextInt(), in.NextInt()
		diff := int(math.Abs(float64(a - b)))
		if diff >= 2 || a+b >= n {
			fmt.Println(-1)
		} else {
			arr := make([]int, n)
			if a > b {
				i, j, p := 0, 1, n
				for ; i < a+b && i < n; i++ {
					if i%2 == 0 {
						arr[i] = j
						j++
					} else {
						arr[i] = p
						p--
					}
				}
				for ; i < n; i++ {
					arr[i] = p
					p--
				}
			} else if a < b {
				i, j, p := 0, 1, n
				for ; i <= a+b && i < n; i++ {
					if i%2 != 0 {
						arr[i] = j
						j++
					} else {
						arr[i] = p
						p--
					}
				}
				for ; i < n; i++ {
					arr[i] = j
					j++
				}
			} else {
				i, j, p := 0, 1, n
				for ; i <= a+b && i < n; i++ {
					if i%2 != 0 {
						arr[i] = j
						j++
					} else {
						arr[i] = p
						p--
					}
				}
				for ; i < n; i++ {
					arr[i] = p
					p--
				}
			}

			max, min := 0, 0
			for i := 1; i < n-1; i++ {
				if arr[i-1] < arr[i] && arr[i+1] < arr[i] {
					max++
				} else if arr[i-1] > arr[i] && arr[i+1] > arr[i] {
					min++
				}
			}
			if max == a && min == b {
				for i := 0; i < n; i++ {
					fmt.Print(arr[i], " ")
				}
				fmt.Println()
			} else {
				fmt.Println(-1)
			}

		}

	}
}

func NewCF1608B(r *bufio.Reader) *CF1608B {
	return &CF1608B{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1608B(bufio.NewReader(os.Stdin)).Run()
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func case1(a, b int, n int, out io.Writer) {
	Fprintf(out, "%d ", 1)
	le, ri := 2, n
	turn := true
	for {
		if turn {
			if a == 0 {
				for i := le; i <= ri; i++ {
					Fprintf(out, "%d ", i)
				}
				Fprintln(out)
				return
			}
			Fprintf(out, "%d ", ri)
			ri--
			a--
			// if a == 0 {
			//     for i := ri; i >= le; i-- {
			//         Fprintf(out, "%d ", i)
			//     }
			//     Fprintln(out)
			//     return
			// }
		} else {
			if b == 0 {
				for i := ri; i >= le; i-- {
					Fprintf(out, "%d ", i)
				}
				Fprintln(out)
				return
			}
			Fprintf(out, "%d ", le)
			le++
			b--
		}
		turn = !turn
	}
}
func case2(a, b, n int, out io.Writer) {
	Fprintf(out, "%d ", n)
	le, ri := 1, n-1
	turn := false
	for {
		if turn {
			if a == 0 {
				for i := le; i <= ri; i++ {
					Fprintf(out, "%d ", i)
				}
				Fprintln(out)
				return
			}
			Fprintf(out, "%d ", ri)
			ri--
			a--
		} else {
			if b == 0 {
				for i := ri; i >= le; i-- {
					Fprintf(out, "%d ", i)
				}
				Fprintln(out)
				return
			}
			Fprintf(out, "%d ", le)
			le++
			b--
		}
		turn = !turn
	}
}
func CF1608B(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var t int
	var n, a, b int
	for Fscan(in, &t); t > 0; t-- {
		Fscan(in, &n, &a, &b)
		if a > b+1 || b > a+1 || a+b > n-2 {
			Fprintln(out, -1)
			continue
		}
		if a >= b {
			case1(a, b, n, out)
		} else {
			case2(a, b, n, out)
		}
	}
}

func main() {
	CF1608B(os.Stdin, os.Stdout)
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func abs(n int) int {
	if n < 0 {
		return n * -1
	}
	return n
}

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)

	for t := 0; t < T; t++ {
		var n, a, b int
		fmt.Fscan(in, &n, &a, &b)

		if abs(a-b) > 1 || a+b > n-2 {
			fmt.Fprintln(out, -1)
		} else {
			arr := make([]int, n)
			for i := 0; i < n; i++ {
				arr[i] = i + 1
			}

			if a > b {
				arr[n-1], arr[n-2] = arr[n-2], arr[n-1]
				a--
			}

			if b > a {
				arr[0], arr[1] = arr[1], arr[0]
				b--
			}

			for i := 2; i < n; i++ {
				if a == 0 {
					break
				}

				if a > 0 && arr[i]-arr[i-1] == 1 {
					arr[i], arr[i-1] = arr[i-1], arr[i]
					a--
					b--
				}

			}

			for _, v := range arr {
				fmt.Fprintf(out, "%d ", v)
			}
			fmt.Fprintln(out)
		}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func CF1608B(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T, n, u, d int
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n, &u, &d)
		if u-d > 1 || d-u > 1 || u+d > n-2 {
			Fprintln(out, -1)
			continue
		}
		if u > d {
			v, w := 1, n
			i := 0
			for ; i < n; i++ {
				if i&1 == 0 {
					Fprint(out, v, " ")
					v++
				} else {
					Fprint(out, w, " ")
					w--
					if u--; u == 0 {
						break
					}
				}
			}
			for i++; i < n; i++ {
				Fprint(out, w, " ")
				w--
			}
		} else if u == d {
			v, w := 1, n
			i := 0
			for ; i < n; i++ {
				if i&1 == 0 {
					Fprint(out, v, " ")
					v++
					if d--; d == -1 {
						break
					}
				} else {
					Fprint(out, w, " ")
					w--
				}
			}
			for i++; i < n; i++ {
				Fprint(out, v, " ")
				v++
			}
		} else {
			v, w := 1, n
			i := 0
			for ; i < n; i++ {
				if i&1 == 1 {
					Fprint(out, v, " ")
					v++
					if d--; d == 0 {
						break
					}
				} else {
					Fprint(out, w, " ")
					w--
				}
			}
			for i++; i < n; i++ {
				Fprint(out, v, " ")
				v++
			}
		}
		Fprintln(out)
	}
}

func main() { CF1608B(os.Stdin, os.Stdout) }

package main

import (
	"bufio"
	"os"
	"fmt"

	"math/rand"
	"time"
)

const MOD int64 = 1000000007

var n, a, b int

var r *bufio.Reader
var w *bufio.Writer

const LOCAL = false

func main() {

	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)

	if LOCAL {
		n = 1000

		rand.Seed(time.Now().UnixNano())

		for i := 0; i < 1000; i++ {
			a = 1 + rand.Intn(n/2)
			b = 1 + rand.Intn(n/2)

			arr := solve()

			if len(arr) == 1 {
				continue
			}

			lmax := 0
			lmin := 0

			for j := 1; j < n - 1; j++ {
				if arr[j] > arr[j -1] && arr[j] > arr[j + 1] {
					lmax ++
				} else if arr[j] < arr[j - 1] && arr[j] < arr[j + 1] {
					lmin++
				}
			}

			if lmax != a && lmin != b {
				fmt.Println("ERROR")
				fmt.Println(a, b)
				fmt.Println(arr)

				break
			}

		}

		return
	}

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		fmt.Fscan(r, &n, &a, &b)

		solve()

		w.Flush()
	}
}

func solve() []int {

	if a == 0 && b == 0 {
		for i := 1; i < n + 1; i++ {
			fmt.Fprint(w, i, " ")
		}
		return []int{-1}
	}

	if a + b > n - 2 {
		fmt.Fprintln(w,-1)
		return []int{-1}
	}

	if abs(a - b) > 1 {
		fmt.Fprintln(w, -1)
		return []int{-1}
	}

	var maxA int
	var maxB int

	if n % 2 == 0 {
		maxA = (n - 2)/2
		maxB = (n - 2)/2
	} else {
		maxA = (n - 2)/2  + 1
		maxB = (n - 2)/2
	}

	s := maxA + maxB

	curLow := 1
	curHigh := n

	var cnt = 0

	var arr []int

	if a >= b {
		fmt.Fprint(w, curLow, " ")
		arr = append(arr, curLow)
		curLow++
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curHigh, " ")
			arr = append(arr, curHigh)
			curHigh--
			cnt++
		}

		var p int = 1

		for ; cnt < n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curHigh, " ")
				arr = append(arr, curHigh)
				curHigh--
			} else {
				fmt.Fprint(w, curLow, " ")
				arr = append(arr, curLow)
				curLow++
			}

			cnt++
			p++
		}

	} else {
		fmt.Fprint(w, curHigh, " ")
		arr = append(arr, curHigh)
		curHigh--
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curLow, " ")
			arr = append(arr, curLow)
			curLow++
			cnt++
		}

		var p int = 1

		for ; cnt < n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curLow, " ")
				arr = append(arr, curLow)
				curLow++
			} else {
				fmt.Fprint(w, curHigh, " ")
				arr = append(arr, curHigh)
				curHigh--
			}

			p++
			cnt++
		}
	}

	fmt.Fprintln(w)

	return arr
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import "fmt"

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func main() {
	var T, n, a, b int
	fmt.Scanln(&T)
	for T > 0 {
		T--
		fmt.Scanf("%d %d %d\n", &n, &a, &b)
		if a+b+2 > n || abs(a-b) > 1 {
			fmt.Println(-1)
			continue
		}
		l, r := 1, n
		t := a > b
		for i := 1; i <= n; i++ {
			if t {
				fmt.Print(l, " ")
				l++
			} else {
				fmt.Print(r, " ")
				r--
			}
			if i <= a+b {
				t = !t
			}
		}
		fmt.Println()
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strings"
)

/*
4
7 2 0
7 2 3
7 3 2
6 2 2
---
-1
2 1 4 3 6 5 7
1 3 2 5 4 7 6
2 1 4 3 6 5
=====
6
5 0 0
5 2 1
5 1 2
5 1 1
5 1 0
5 0 1
---
1 2 3 4 5
1 3 2 5 4
2 1 4 3 5
2 1 3 5 4
1 2 3 5 4
2 1 3 4 5
=======
3
2 0 0
3 1 0
3 0 1
---
1 2
1 3 2
2 1 3
========
4
4 2 0
4 1 0
4 0 1
4 1 1
---
========
6
6 4 0
6 3 1
6 1 3
6 2 0
6 0 2
6 3 3
---
-1
-1
-1
-1
-1
-1
=======
1
6 2 2
---
*/

//goland:noinspection GoUnhandledErrorResult
func main() {
	defer writer.Flush()

	bld := strings.Builder{}

	var t = 1
	scanf("%d\n", &t)

	for ; t > 0; t-- {
		var n, a, b int
		scanf("%d %d %d\n", &n, &a, &b)

		if a+b > n-2 || abs(a-b) > 1 {
			fmt.Fprintln(&bld, -1)
		} else {
			p := make([]int, n)
			for i := 0; i < n; i++ {
				p[i] = i + 1
			}

			if a == 1 && b == 1 {
				p[0], p[1] = p[1], p[0]
				p[n-1], p[n-2] = p[n-2], p[n-1]
			} else if a < b {
				for i := 0; i < b; i++ {
					idx := 2 * i
					p[idx], p[idx+1] = p[idx+1], p[idx]
				}
			} else {
				for i := n - 1; i > n-2*a; i -= 2 {
					p[i], p[i-1] = p[i-1], p[i]
				}
				if a != 0 && a == b {
					p[0], p[1] = p[1], p[0]
				}
			}

			for _, num := range p {
				fmt.Fprintf(&bld, "%d ", num)
			}
			fmt.Fprintln(&bld)
		}
	}

	printf("%s", bld.String())
}

const maxUint = ^uint(0)

//goland:noinspection GoUnusedConst
const minUint = 0
const maxInt = int(maxUint >> 1)

//goland:noinspection GoUnusedConst
const minInt = -maxInt - 1

//goland:noinspection GoUnusedType
type pair struct {
	fst int
	snd int
}

var reader = bufio.NewReader(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

//goland:noinspection GoUnusedFunction
func printf(f string, a ...interface{}) {
	if _, err := fmt.Fprintf(writer, f, a...); err != nil {
		panic(err)
	}
}

func scanf(f string, a ...interface{}) {
	if _, err := fmt.Fscanf(reader, f, a...); err != nil {
		panic(err)
	}
}

//goland:noinspection GoUnusedFunction
func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

//goland:noinspection GoUnusedFunction
func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

//goland:noinspection GoUnusedFunction
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//goland:noinspection GoUnusedFunction
func isPrime(n int) bool {
	if n == 2 || n == 3 {
		return true
	}

	if n <= 1 || n%2 == 0 || n%3 == 0 {
		return false
	}

	for i := 5; i*i <= n; i += 6 {
		if n%i == 0 || n%(i+2) == 0 {
			return false
		}
	}

	return true
}

//goland:noinspection GoUnusedFunction
func gcd(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

//goland:noinspection GoUnusedFunction
func lcm(a, b int) int {
	return abs(a) / gcd(a, b) * abs(b)
}

// Examples:
//	digitAt(1234, -1) -> panic!
//	digitAt(1234, 0) -> 4
//	digitAt(1234, 1) -> 3
//	digitAt(1234, 2) -> 2
//	digitAt(1234, 3) -> 1
//	digitAt(1234, 4) -> panic!
//goland:noinspection GoUnusedFunction
func digitAt(num, pos int) int {
	lenNum := int(math.Log10(float64(num))) + 1
	if pos < 0 || pos >= lenNum {
		err := fmt.Sprintf("Out of bound access for digit. Position passed %d, number %d", pos, num)
		panic(err)
	}

	rem := num % int(math.Pow10(pos+1))
	return rem / int(math.Pow10(pos))
}

package main

import (
	"bufio"
	"os"
	"fmt"

	"math/rand"
	"time"
)

const MOD int64 = 1000000007

var n, a, b int

var r *bufio.Reader
var w *bufio.Writer

const LOCAL = false

func main() {

	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)

	if LOCAL {
		n = 1000

		rand.Seed(time.Now().UnixNano())

		for i := 0; i < 1000; i++ {
			a = 1 + rand.Intn(n/2)
			b = 1 + rand.Intn(n/2)

			arr := solve()

			if len(arr) == 1 {
				continue
			}

			lmax := 0
			lmin := 0

			for j := 1; j < n - 1; j++ {
				if arr[j] > arr[j -1] && arr[j] > arr[j + 1] {
					lmax ++
				} else if arr[j] < arr[j - 1] && arr[j] < arr[j + 1] {
					lmin++
				}
			}

			if lmax != a && lmin != b {
				fmt.Println("ERROR")
				fmt.Println(a, b)
				fmt.Println(arr)

				break
			}

		}

		return
	}

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		fmt.Fscan(r, &n, &a, &b)

		solve()

		w.Flush()
	}
}

func solve() []int {

	if a == 0 && b == 0 {
		for i := 1; i < n + 1; i++ {
			fmt.Fprint(w, i, " ")

			return []int{-1}
		}
	}

	if a + b > n - 2 {
		fmt.Fprintln(w,-1)
		return []int{-1}
	}

	if abs(a - b) > 1 {
		fmt.Fprintln(w, -1)
		return []int{-1}
	}

	var maxA int
	var maxB int

	if n % 2 == 0 {
		maxA = (n - 2)/2
		maxB = (n - 2)/2
	} else {
		maxA = (n - 2)/2  + 1
		maxB = (n - 2)/2
	}

	s := maxA + maxB

	curLow := 1
	curHigh := n

	var cnt = 0

	var arr []int

	if a >= b {
		fmt.Fprint(w, curLow, " ")
		arr = append(arr, curLow)
		curLow++
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curHigh, " ")
			arr = append(arr, curHigh)
			curHigh--
			cnt++
		}

		var p int = 1

		for ; cnt < n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curHigh, " ")
				arr = append(arr, curHigh)
				curHigh--
			} else {
				fmt.Fprint(w, curLow, " ")
				arr = append(arr, curLow)
				curLow++
			}

			cnt++
			p++
		}

	} else {
		fmt.Fprint(w, curHigh, " ")
		arr = append(arr, curHigh)
		curHigh--
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curLow, " ")
			arr = append(arr, curLow)
			curLow++
			cnt++
		}

		var p int = 1

		for ; cnt < n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curLow, " ")
				arr = append(arr, curLow)
				curLow++
			} else {
				fmt.Fprint(w, curHigh, " ")
				arr = append(arr, curHigh)
				curHigh--
			}

			p++
			cnt++
		}
	}

	fmt.Fprintln(w)

	return arr
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"os"
	"fmt"

	"math/rand"
	"time"
)

const MOD int64 = 1000000007

var n, a, b int

var r *bufio.Reader
var w *bufio.Writer

const LOCAL = false

func main() {

	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)

	if LOCAL {
		n = 1000

		rand.Seed(time.Now().UnixNano())

		for i := 0; i < 1000; i++ {
			a = 1 + rand.Intn(n/2)
			b = 1 + rand.Intn(n/2)

			arr := solve()

			if len(arr) == 1 {
				continue
			}

			lmax := 0
			lmin := 0

			for j := 1; j < n - 1; j++ {
				if arr[j] > arr[j -1] && arr[j] > arr[j + 1] {
					lmax ++
				} else if arr[j] < arr[j - 1] && arr[j] < arr[j + 1] {
					lmin++
				}
			}

			if lmax != a && lmin != b {
				fmt.Println("ERROR")
				fmt.Println(a, b)
				fmt.Println(arr)

				break
			}

		}

		return
	}

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		fmt.Fscan(r, &n, &a, &b)

		solve()

		w.Flush()
	}
}

func solve() []int {
	if a + b > n - 2 {
		fmt.Fprintln(w,-1)
		return []int{-1}
	}

	if abs(a - b) > 1 {
		fmt.Fprintln(w, -1)
		return []int{-1}
	}

	var maxA int
	var maxB int

	if n % 2 == 0 {
		maxA = (n - 2)/2
		maxB = (n - 2)/2
	} else {
		maxA = (n - 2)/2  + 1
		maxB = (n - 2)/2
	}

	s := maxA + maxB

	curLow := 1
	curHigh := n

	var cnt = 0

	var arr []int

	if a >= b {
		fmt.Fprint(w, curLow, " ")
		arr = append(arr, curLow)
		curLow++
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curHigh, " ")
			arr = append(arr, curHigh)
			curHigh--
			cnt++
		}

		var p int = 1

		for ; cnt < n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curHigh, " ")
				arr = append(arr, curHigh)
				curHigh--
			} else {
				fmt.Fprint(w, curLow, " ")
				arr = append(arr, curLow)
				curLow++
			}

			cnt++
			p++
		}

	} else {
		fmt.Fprint(w, curHigh, " ")
		arr = append(arr, curHigh)
		curHigh--
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curLow, " ")
			arr = append(arr, curLow)
			curLow++
			cnt++
		}

		var p int = 1

		for ; cnt < n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curLow, " ")
				arr = append(arr, curLow)
				curLow++
			} else {
				fmt.Fprint(w, curHigh, " ")
				arr = append(arr, curHigh)
				curHigh--
			}

			p++
			cnt++
		}
	}

	fmt.Fprintln(w)

	return arr
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"os"
	"fmt"

)

const MOD int64 = 1000000007

var n, a, b int

var r *bufio.Reader
var w *bufio.Writer

func main() {

	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		fmt.Fscan(r, &n, &a, &b)

		solve()
	}
}

func solve()  {
	if a + b > n - 2 {
		fmt.Println(-1)
		return
	}

	if abs(a - b) > 1 {
		fmt.Println(-1)
		return
	}

	var maxA int
	var maxB int

	if n % 2 == 0 {
		maxA = (n - 2)/2
		maxB = (n - 2)/2
	} else {
		maxA = (n - 2)/2  + 1
		maxB = (n - 2)/2
	}

	s := maxA + maxB

	curLow := 1
	curHigh := n

	var cnt = 0

	if a >= b {
		fmt.Fprint(w, curLow, " ")
		curLow++
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curHigh, " ")
			curHigh--
			cnt++
		}

		var p int = 1

		for ; cnt < n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curHigh, " ")
				curHigh--
			} else {
				fmt.Fprint(w, curLow, " ")
				curLow++
			}

			cnt++
			p++
		}

	} else {
		fmt.Fprint(w, curHigh, " ")
		curHigh--
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curLow, " ")
			curLow++
			cnt++
		}

		var p int = 1

		for ; cnt < n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curLow, " ")
				curLow++
			} else {
				fmt.Fprint(w, curHigh, " ")
				curHigh--
			}

			p++
			cnt++
		}
	}

	fmt.Fprintln(w)
	w.Flush()
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"os"
	"fmt"

)

const MOD int64 = 1000000007

var n, a, b int

var r *bufio.Reader
var w *bufio.Writer

func main() {

	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		fmt.Fscan(r, &n, &a, &b)

		solve()
	}
}

func solve()  {
	if a + b > n - 2 {
		fmt.Println(-1)
		return
	}

	if abs(a - b) > 1 {
		fmt.Println(-1)
		return
	}

	var maxA int
	var maxB int

	if n % 2 == 0 {
		maxA = (n - 2)/2
		maxB = (n - 2)/2
	} else {
		maxA = (n - 2)/2  + 1
		maxB = (n - 2)/2
	}

	s := maxA + maxB

	curLow := 1
	curHigh := n

	var cnt = 0

	if a >= b {
		fmt.Fprint(w, curLow, " ")
		curLow++
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curHigh, " ")
			curHigh--
			cnt++
		}

		var p int = 1

		for ; cnt <= n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curHigh, " ")
				curHigh--
			} else {
				fmt.Fprint(w, curLow, " ")
				curLow++
			}

			cnt++
			p++
		}

	} else {
		fmt.Fprint(w, curHigh, " ")
		curHigh--
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curLow, " ")
			curLow++
			cnt++
		}

		var p int = 1

		for ;cnt <= n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curLow, " ")
				curLow++
			} else {
				fmt.Fprint(w, curHigh, " ")
				curHigh--
			}

			p++
			cnt++
		}
	}

	w.Flush()
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"os"
	"fmt"

)

const MOD int64 = 1000000007

var n, a, b int

var r *bufio.Reader
var w *bufio.Writer

func main() {

	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		fmt.Fscan(r, &n, &a, &b)

		solve()
	}
}

func solve()  {
	if a + b > n - 2 {
		fmt.Println(-1)
		return
	}

	if abs(a - b) > 1 {
		fmt.Println(-1)
		return
	}

	var maxA int
	var maxB int

	if n % 2 == 0 {
		maxA = (n - 2)/2
		maxB = (n - 2)/2
	} else {
		maxA = (n - 2)/2  + 1
		maxB = (n - 2)/2
	}

	s := maxA + maxB

	curLow := 1
	curHigh := n

	var cnt = 0

	if a >= b {
		fmt.Fprint(w, curLow, " ")
		curLow++
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curHigh, " ")
			curHigh--
			cnt++
		}

		var p int = 1

		for ;curLow <= curHigh && cnt <= n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curHigh, " ")
				curHigh--
			} else {
				fmt.Fprint(w, curLow, " ")
				curLow++
			}

			cnt++
			p++
		}

	} else {
		fmt.Fprint(w, curHigh, " ")
		curHigh--
		cnt++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curLow, " ")
			curLow++
			cnt++
		}

		var p int = 1

		for ;curLow <= curHigh && cnt <= n; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curLow, " ")
				curLow++
			} else {
				fmt.Fprint(w, curHigh, " ")
				curHigh--
			}

			p++
			cnt++
		}
	}

	w.Flush()
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import (
	"bufio"
	"os"
	"fmt"

)

const MOD int64 = 1000000007

var n, a, b int

var r *bufio.Reader
var w *bufio.Writer

func main() {

	r = bufio.NewReader(os.Stdin)
	w = bufio.NewWriter(os.Stdout)

	var t int
	fmt.Fscan(r, &t)

	for i := 0; i < t; i++ {
		fmt.Fscan(r, &n, &a, &b)

		solve()
	}
}

func solve()  {
	if a + b > n - 2 {
		fmt.Println(-1)
		return
	}

	if abs(a - b) > 1 {
		fmt.Println(-1)
		return
	}

	var maxA int
	var maxB int

	if n % 2 == 0 {
		maxA = (n - 2)/2
		maxB = (n - 2)/2
	} else {
		maxA = (n - 2)/2  + 1
		maxB = (n - 2)/2
	}

	s := maxA + maxB

	curLow := 1
	curHigh := n

	if a >= b {
		fmt.Fprint(w, curLow, " ")
		curLow++

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curHigh, " ")
			curHigh--
		}

		fmt.Fprint(w, curLow, " ")
		curLow++

		var p int

		for ;curLow <= curHigh; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curHigh, " ")
				curHigh--
			} else {
				fmt.Fprint(w, curLow, " ")
				curLow++
			}

			p++
		}

	} else {
		fmt.Fprint(w, curHigh, " ")
		curHigh--

		for j := 0; j < s - (a + b) + 1; j++ {
			fmt.Fprint(w, curLow, " ")
			curLow++
		}

		fmt.Fprint(w, curHigh, " ")
		curHigh--

		var p int

		for ;curLow <= curHigh; {
			iter := p % 2

			if iter == 0 {
				fmt.Fprint(w, curLow, " ")
				curLow++
			} else {
				fmt.Fprint(w, curHigh, " ")
				curHigh--
			}

			p++
		}
	}

	w.Flush()
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

package main

import "fmt"

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func main() {
	var T, n, a, b int
	fmt.Scanln(&T)
	for T > 0 {
		T--
		fmt.Scanf("%d %d %d", &n, &a, &b)
		if a+b+2 > n || abs(a-b) > 1 {
			fmt.Println(-1)
			continue
		}
		l, r := 1, n
		t := a > b
		for i := 1; i <= n; i++ {
			if t {
				fmt.Print(l, " ")
				l++
			} else {
				fmt.Print(r, " ")
				r--
			}
			if i <= a+b {
				t = !t
			}
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strings"
)

/*
4
7 2 0
7 2 3
7 3 2
6 2 2
---
-1
2 1 4 3 6 5 7
1 3 2 5 4 7 6
2 1 4 3 6 5
=====
4
5 0 0
5 2 1
5 1 2
5 1 1
---
1 2 3 4 5
1 3 2 5 4
2 1 4 3 5
2 1 3 5 4
=======
3
2 0 0
3 1 0
3 0 1
---
1 2
1 3 2
2 1 3
*/

//goland:noinspection GoUnhandledErrorResult
func main() {
	defer writer.Flush()

	bld := strings.Builder{}

	var t = 1
	scanf("%d\n", &t)

	for ; t > 0; t-- {
		var n, a, b int
		scanf("%d %d %d\n", &n, &a, &b)

		if a+b > n-2 || abs(a-b) > 1 {
			fmt.Fprintln(&bld, -1)
		} else {
			p := make([]int, n)
			for i := 0; i < n; i++ {
				p[i] = i + 1
			}

			if a == 1 && b == 1 {
				p[0], p[1] = p[1], p[0]
				p[n-1], p[n-2] = p[n-2], p[n-1]
			} else if a < b {
				for i := 0; i < b; i++ {
					idx := 2 * i
					p[idx], p[idx+1] = p[idx+1], p[idx]
				}
			} else {
				for i := n - 1; i > n-2*a; i -= 2 {
					p[i], p[i-1] = p[i-1], p[i]
				}
			}

			for _, num := range p {
				fmt.Fprintf(&bld, "%d ", num)
			}
			fmt.Fprintln(&bld)
		}
	}

	printf("%s", bld.String())
}

const maxUint = ^uint(0)

//goland:noinspection GoUnusedConst
const minUint = 0
const maxInt = int(maxUint >> 1)

//goland:noinspection GoUnusedConst
const minInt = -maxInt - 1

//goland:noinspection GoUnusedType
type pair struct {
	fst int
	snd int
}

var reader = bufio.NewReader(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

//goland:noinspection GoUnusedFunction
func printf(f string, a ...interface{}) {
	if _, err := fmt.Fprintf(writer, f, a...); err != nil {
		panic(err)
	}
}

func scanf(f string, a ...interface{}) {
	if _, err := fmt.Fscanf(reader, f, a...); err != nil {
		panic(err)
	}
}

//goland:noinspection GoUnusedFunction
func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

//goland:noinspection GoUnusedFunction
func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

//goland:noinspection GoUnusedFunction
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

//goland:noinspection GoUnusedFunction
func isPrime(n int) bool {
	if n == 2 || n == 3 {
		return true
	}

	if n <= 1 || n%2 == 0 || n%3 == 0 {
		return false
	}

	for i := 5; i*i <= n; i += 6 {
		if n%i == 0 || n%(i+2) == 0 {
			return false
		}
	}

	return true
}

//goland:noinspection GoUnusedFunction
func gcd(a, b int) int {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

//goland:noinspection GoUnusedFunction
func lcm(a, b int) int {
	return abs(a) / gcd(a, b) * abs(b)
}

// Examples:
//	digitAt(1234, -1) -> panic!
//	digitAt(1234, 0) -> 4
//	digitAt(1234, 1) -> 3
//	digitAt(1234, 2) -> 2
//	digitAt(1234, 3) -> 1
//	digitAt(1234, 4) -> panic!
//goland:noinspection GoUnusedFunction
func digitAt(num, pos int) int {
	lenNum := int(math.Log10(float64(num))) + 1
	if pos < 0 || pos >= lenNum {
		err := fmt.Sprintf("Out of bound access for digit. Position passed %d, number %d", pos, num)
		panic(err)
	}

	rem := num % int(math.Pow10(pos+1))
	return rem / int(math.Pow10(pos))
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
	"sort"
)

func main() {
	reader := bufio.NewReader(os.Stdin)

	tc := readNum(reader)

	var buf bytes.Buffer

	for tc > 0 {
		tc--
		n := readNum(reader)
		A := readNNums(reader, n)
		res := solve(n, A)
		buf.WriteString(fmt.Sprintf("%d\n", res))
	}

	fmt.Print(buf.String())
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(n int, A []int) int {
	sort.Ints(A)
	dp := make([]int, A[n-1]+1)

	var best = 1

	for i := 0; i < n; i++ {
		cur := A[i]
		if i == 0 || A[i] != A[i-1] {
			// find divisors of cur
			for x := 1; x <= cur/x; x++ {
				if cur%x == 0 {
					y := cur / x
					dp[cur] = max(dp[cur], max(dp[y], dp[x])+1)
				}
			}
		} else {
			dp[cur]++
		}
		// if we keep cur
		best = max(best, dp[cur])
	}
	return n - best
}

func max(a, b int) int {
	if a >= b {
		return a
	}
	return b
}

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
	"sort"
)

func main() {
	reader := bufio.NewReader(os.Stdin)

	tc := readNum(reader)

	var buf bytes.Buffer

	for tc > 0 {
		tc--
		n := readNum(reader)
		A := readNNums(reader, n)
		res := solve(n, A)
		buf.WriteString(fmt.Sprintf("%d\n", res))
	}

	fmt.Print(buf.String())
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(n int, A []int) int {
	var mx int
	for i := 0; i < n; i++ {
		mx = max(mx, A[i])
	}

	mx++

	cnt := make([]int, mx)
	dp := make([]int, mx)

	for i := 0; i < n; i++ {
		cnt[A[i]]++
	}
	var best int
	for i := 1; i < mx; i++ {
		dp[i] += cnt[i]
		for j := 2 * i; j < mx; j += i {
			dp[j] = max(dp[j], dp[i])
		}
		best = max(best, dp[i])
	}

	return n - best
}

func solve1(n int, A []int) int {
	sort.Ints(A)
	dp := make([]int, A[n-1]+1)

	var best = 1

	for i := 0; i < n; i++ {
		cur := A[i]
		if i == 0 || A[i] != A[i-1] {
			// find divisors of cur
			for x := 1; x <= cur/x; x++ {
				if cur%x == 0 {
					y := cur / x
					dp[cur] = max(dp[cur], max(dp[y], dp[x])+1)
				}
			}
		} else {
			dp[cur]++
		}
		// if we keep cur
		best = max(best, dp[cur])
	}
	return n - best
}

func max(a, b int) int {
	if a >= b {
		return a
	}
	return b
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"sort"
	"strings"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	const mx int = 2e5
	divisors := [mx + 1][]int{}
	for i := 1; i <= mx; i++ {
		for j := i; j <= mx; j += i {
			divisors[j] = append(divisors[j], i)
		}
	}

	solve := func(Case int) {
		var n int
		Fscan(in, &n)

		dp := make([]int, 2e5+1)

		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		sort.Ints(a)
		mx := 0
		for i := 0; i < n; {
			st := i
			v := a[st]
			for ; i < n && a[i] == v; i++ {
			}
			if v == 1 {
				dp[1] = i-st
				mx = max(mx, dp[1])
				continue
			}
			for _, d := range divisors[v] {
				if d == v {
					continue
				}
				dp[v] = max(dp[v], dp[d]+i-st)
				mx = max(mx, dp[v])
			}
		}
		Fprintln(out, n-mx)
	}

	var t int
	Fscan(in, &t)
	for Case := 1; Case <= t; Case++ {
		solve(Case)
	}

	_leftData, _ := ioutil.ReadAll(in)
	if _s := strings.TrimSpace(string(_leftData)); _s != "" {
		panic("有未读入的数据：\n" + _s)
	}
}

func main() { run(os.Stdin, os.Stdout) }

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader = bufio.NewReader(os.Stdin)
var writer = bufio.NewWriter(os.Stdout)

func scan(a ...interface{})             { fmt.Fscan(reader, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func redirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

func main() {
	defer writer.Flush()
// 	redirectInputToFile(reader, "input.txt")

	T := 1
	scan(&T)
	for t := 0; t < T; t++ {
		solve()
	}
}

func solve() {
	var n int
	scan(&n)
	var cnt = make([]int, 2e5+1)
	for i := 0; i < n; i++ {
		var x int
		scan(&x)
		cnt[x]++
	}
	var dp = make([]int, 2e5+1)
	for i := int(2e5); i >= 1; i-- {
		if cnt[i] == 0 {
			continue
		}
		for j := i; j <= 2e5; j += i {
			if cnt[j] == 0 {
				continue
			}
			dp[i] = max(dp[i], dp[j]+cnt[i])
		}
	}
	printf("%v\n", n-max(dp...))
}

func max(s ...int) int {
	r := s[0]
	for _, i := range s {
		if r < i {
			r = i
		}
	}
	return r
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func UniqueInts(v []int) []int {
	prev := int(0)
	if len(v) > 0 && v[0] == prev {
		prev = -1
	}

	i := 0
	for j := range v {
		if v[j] != prev {
			prev = v[j]
			v[i], v[j] = v[j], v[i]
			i++
		}
	}

	return v[:i]
}

func solve(a []int) {
	n := len(a)
	sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })

	cnt := make([]int, a[n-1]+1)
	for i := range a {
		cnt[a[i]]++
	}

	a = UniqueInts(a)
	prevN := n
	n = len(a)

	dp := make([]int, a[n-1]+1)
	dp[a[n-1]] = cnt[a[n-1]]

	ans := dp[a[n-1]]
	for i := n - 2; i >= 0; i-- {
		dp[a[i]] = cnt[a[i]]
		for j := 2 * a[i]; j <= a[n-1]; j += a[i] {
			if dp[a[i]] < dp[j]+cnt[a[i]] {
				dp[a[i]] = dp[j] + cnt[a[i]]
			}
		}
		if ans < dp[a[i]] {
			ans = dp[a[i]]
		}
	}

	printf("%d\n", prevN-ans)
}

func main() {
	defer writer.Flush()
	//RedirectInputToFile(reader, "input.txt")

	T := 1
	scan(&T)

	var n int
	var a []int

	for t := 0; t < T; t++ {
		scan(&n)

		a = make([]int, n)
		for i := 0; i < n; i++ {
			scan(&a[i])
		}

		solve(a)
	}
}

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func scan(a ...interface{})             { fmt.Fscan(reader, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func RedirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func UniqueInts(v []int) []int {
	prev := int(0)
	if len(v) > 0 && v[0] == prev {
		prev = -1
	}

	i := 0
	for j := range v {
		if v[j] != prev {
			prev = v[j]
			v[i], v[j] = v[j], v[i]
			i++
		}
	}

	return v[:i]
}

func solve(a []int) {
	n := len(a)
	sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })

	cnt := make([]int, a[n-1]+1)
	for i := range a {
		cnt[a[i]]++
	}

	a = UniqueInts(a)
	prevN := n
	n = len(a)

	dp := make([]int, a[n-1]+1)
	dp[a[n-1]] = cnt[a[n-1]]

	ans := 1
	for i := n - 2; i >= 0; i-- {
		dp[a[i]] = cnt[a[i]]
		for j := 2 * a[i]; j <= a[n-1]; j += a[i] {
			if dp[a[i]] < dp[j]+cnt[a[i]] {
				dp[a[i]] = dp[j] + cnt[a[i]]
			}
		}
		if ans < dp[a[i]] {
			ans = dp[a[i]]
		}
	}

	printf("%d\n", prevN-ans)
}

func main() {
	defer writer.Flush()
	//RedirectInputToFile(reader, "input.txt")

	T := 1
	scan(&T)

	var n int
	var a []int

	for t := 0; t < T; t++ {
		scan(&n)

		a = make([]int, n)
		for i := 0; i < n; i++ {
			scan(&a[i])
		}

		solve(a)
	}
}

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func scan(a ...interface{})             { fmt.Fscan(reader, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func RedirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var n int
var a []int
var dp [2e5 + 1]int
var ans int = 1

func solve() {
	dp[a[n-1]] = 1
	for i := n - 2; i >= 0; i-- {
		dp[a[i]] = 1
		for j := a[i]; j <= a[n-1]; j += a[i] {
			if dp[a[i]] < dp[j]+1 {
				dp[a[i]] = dp[j] + 1
			}
		}
		if ans < dp[a[i]] {
			ans = dp[a[i]]
		}
	}
	printf("%d\n", n-ans)
}

func main() {
	defer writer.Flush()
	//RedirectInputToFile(reader, "input.txt")

	T := 1
	scan(&T)

	for t := 0; t < T; t++ {
		scan(&n)

		a = make([]int, n)
		for i := 0; i < n; i++ {
			scan(&a[i])
		}

		solve()
	}
}

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func scan(a ...interface{})             { fmt.Fscan(reader, a...) }
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }

func RedirectInputToFile(r *bufio.Reader, fp string) {
	f, err := os.Open(fp)
	if err != nil {
		panic(err)
	}
	r.Reset(f)
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"sort"
	"strings"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	const mx int = 2e5
	divisors := [mx + 1][]int{}
	for i := 1; i <= mx; i++ {
		for j := i; j <= mx; j += i {
			divisors[j] = append(divisors[j], i)
		}
	}

	solve := func(Case int) {
		var n int
		Fscan(in, &n)

		dp := make([]int, 2e5+1)

		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		sort.Ints(a)
		mx := 0
		for i := 0; i < n; {
			st := i
			v := a[st]
			for ; i < n && a[i] == v; i++ {
			}
			if v == 1 {
				dp[1] = i-st
				continue
			}
			for _, d := range divisors[v] {
				if d == v {
					continue
				}
				dp[v] = max(dp[v], dp[d]+i-st)
				mx = max(mx, dp[v])
			}
		}
		Fprintln(out, n-mx)
	}

	var t int
	Fscan(in, &t)
	for Case := 1; Case <= t; Case++ {
		solve(Case)
	}

	_leftData, _ := ioutil.ReadAll(in)
	if _s := strings.TrimSpace(string(_leftData)); _s != "" {
		panic("有未读入的数据：\n" + _s)
	}
}

func main() { run(os.Stdin, os.Stdout) }

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"sort"
	"strings"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	const mx int = 2e5
	divisors := [mx + 1][]int{}
	for i := 1; i <= mx; i++ {
		for j := i; j <= mx; j += i {
			divisors[j] = append(divisors[j], i)
		}
	}

	solve := func(Case int) {
		var n int
		Fscan(in, &n)

		dp := make([]int, 2e5+1)

		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		sort.Ints(a)
		mx := 0
		for i := 0; i < n; {
			st := i
			v := a[st]
			for ; i < n && a[i] == v; i++ {
			}
			for _, d := range divisors[v] {
				if d == v {
					continue
				}
				dp[v] = max(dp[v], dp[d]+i-st)
				mx = max(mx, dp[v])
			}
		}
		Fprintln(out, n-mx)
	}

	var t int
	Fscan(in, &t)
	for Case := 1; Case <= t; Case++ {
		solve(Case)
	}

	_leftData, _ := ioutil.ReadAll(in)
	if _s := strings.TrimSpace(string(_leftData)); _s != "" {
		panic("有未读入的数据：\n" + _s)
	}
}

func main() { run(os.Stdin, os.Stdout) }

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}