// use std::ops::{Index, IndexMut};
// use std::cmp::{Ordering, min, max};
// use std::collections::{BinaryHeap, BTreeMap};
// use std::collections::btree_map::Entry::{Occupied, Vacant};
// use std::clone::Clone;

fn getline() -> String{
    let mut res = String::new();
    std::io::stdin().read_line(&mut res).ok();
    res
}

macro_rules! readl {
    ($t: ty) => {
        {
            let s = getline();
            s.trim().parse::<$t>().unwrap()
        }
    };
    ($( $t: ty),+ ) => {
        {
            let s = getline();
            let mut iter = s.trim().split(' ');
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*) 
        }
    };
}

macro_rules! readlvec {
    ($t: ty) => {
        {
            let s = getline();
            let iter = s.trim().split(' ');
            iter.map(|x| x.parse().unwrap()).collect::<Vec<$t>>()
        }
    }
}

macro_rules! mvec {
    ($v: expr, $s: expr) => {
        vec![$v; $s]
    };
    ($v: expr, $s: expr, $($t: expr),*) => {
        vec![mvec!($v, $($t),*); $s]
    };
}

macro_rules! debug {
    ($x: expr) => {
        println!("{}: {:?}", stringify!($x), $x)
    }
}

fn printiter<'a, T>(v: &'a T)
where
    &'a T: std::iter::IntoIterator, 
    <&'a T as std::iter::IntoIterator>::Item: std::fmt::Display {
    for (i,e) in v.into_iter().enumerate() {
        if i != 0 {
            print!(" ");
        }
        print!("{}", e);
    }
    println!("");
}

macro_rules! make_modint {
    ($MOD: expr, $name: ident) => {
        struct $name {
            val: i64,
        }

        impl $name {
            fn new(x: i64) -> $name {
                let x = x%$MOD;
                $name{val: if x < 0 { x+$MOD } else { x }}
            }

            fn pow(&self, x: i64) -> $name {
                let mut res = $name::new(1);
                let mut tmp = x;
                let mut p = *self;
                while tmp != 0 {
                    if tmp&1 == 1 {
                        res *= p;
                    }
                    tmp = tmp>>1;
                    p = p*p;
                }
                res
            }

            fn inv(&self) -> $name {
                assert!(self.val != 0);
                let mut a = self.val;
                let mut b = $MOD;
                let mut u = 1;
                let mut v = 0;
                use std::mem::swap;
                while b != 0 {
                    let t = a/b;
                    a -= t*b;
                    swap(&mut a, &mut b);
                    u -= t*v;
                    swap(&mut u, &mut v);
                }
                $name::new(u)
            }
        }

        impl std::clone::Clone for $name {
            fn clone(&self) -> $name {
                $name{ val: self.val }
            }
        }

        impl std::marker::Copy for $name { }

        impl std::ops::Add for $name {
            type Output = $name;
            fn add(self, y: $name) -> $name {
                let tmp = self.val+y.val;
                $name{val: if tmp >= $MOD {tmp-$MOD} else {tmp}}
            }
        }

        impl std::ops::Neg for $name {
            type Output = $name;
            fn neg(self) -> $name {
                $name::new(self.val)
            }
        }

        impl std::ops::Sub for $name {
            type Output = $name;
            fn sub(self, other: $name) -> $name{
                let tmp = self.val-other.val;
                $name{val: if tmp < 0 {tmp+$MOD} else {tmp}}
            }
        }

        impl std::ops::Mul for $name {
            type Output = $name;
            fn mul(self, y: $name) -> $name {
                $name{val: (self.val*y.val)%$MOD}
            }
        }

        impl std::ops::Div for $name {
            type Output = $name;
            fn div(self, other: $name) -> $name {
                self*other.inv()
            }
        }

        impl std::fmt::Display for $name {
            fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
                write!(f, "{}", self.val)
            }
        }

        impl std::ops::AddAssign for $name {
        fn add_assign(&mut self, other: $name) {
            *self = *self+other;
        }
        }

        impl std::ops::SubAssign for $name {
            fn sub_assign(&mut self, other: $name) {
                *self = *self-other;
            }
        }

        impl std::ops::MulAssign for $name {
            fn mul_assign(&mut self, other: $name) {
                *self = *self*other;
            }
        }

        impl std::ops::DivAssign for $name {
            fn div_assign(&mut self, other: $name) {
                *self = *self*other.inv();
            }
        }

        impl std::fmt::Debug for $name {
            fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
                write!(f, "{}", self.val)
            }
        }
    }
}

make_modint!(1_000_000_000+7, ModInt);

fn mint(x: i64) -> ModInt {
    ModInt::new(x)
}


fn main() {
    // let mut dp = [[[mint(0); 8]; 5]; 41];
    let (n, x, y, z) = readl!(usize, usize, usize , usize);
    // let ls = [x, y, z];
    // dp[0][3][0] = mint(1);
    // for i in 0..n {
    //     for k in 0..3 {
    //         for j in 0..ls[k] {
    //             for num in 1..ls[k]-j {
    //                 dp[i+1][j][num+j]
    //             }
    //         }
    //     }
    // }
    let get_top = |mut mask| -> usize {
        let mut res = 0;
        while mask != 0 {
            mask >>= 1;
            res += 1;
        }
        res
    };
    
    let get_next = |mut mask, num| {
        mask |= (1<<(num-1)) as usize;
        let a = !((1<<(x+y+z))-1);
        while (mask&a) != 0 {
            while (mask&1) == 0 {
                mask >>= 1;
            }
            mask >>= 1;
        }
        // debug!(mask&a);
        // println!("{:b}", a);
        // println!("{:b}", mask);
        mask
    };

    // debug!((1<<(x+y+z))-1);

    let hoge = (1<<x-1)|(1<<(x+y-1))|(1<<(x+y+z-1));
    let is_ok = |mask| {
        (mask & hoge) == hoge
    };
    
    let mut dp = vec![mint(0); 1<<(x+y+z)];
    let mut ans = mint(0);
    dp[0] = mint(1);
    for i in 0..n {
        let mut nex = vec![mint(0); 1<<(x+y+z)];
        for mask in 0..1<<(x+y+z) {
            let top = get_top(mask);
            if is_ok(mask) {
                ans += dp[mask];
            } else {
                for num in 1..11 {
                    let nmask = get_next(mask, top+num);
                    // debug!(mask); debug!(num); debug!(nmask);
                    nex[nmask] += dp[mask];
                }
            }
        }
        // debug!(ans);
        dp = nex;
        // debug!(dp);
        ans *= mint(10);
    }
    for i in 0..dp.len() {
        if is_ok(i) {
            ans += dp[i];
        }
    }
    println!("{}", ans);

}



Measured memory_bytes: 8464