class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.w: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.z: J = None
        self.r: E = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: I = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: E = None
        self.t: J = None
        self.p: I = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: E = None
        self.txt = txt

f = A("f")
a = B("a")
b = C("b")
m = D("m")
l = E("l")
j = F("j")
e = G("e")
k = H("k")
n = I("n")
i = J("i")

f.y = m
f.s = b
f.w = i
a.r = m
a.u = i
b.s = a
b.u = f
b.y = f
b.z = i
b.r = l
m.u = n
l.r = a
l.z = n
l.w = f
j.w = m
e.s = f
e.q = l
e.t = i
e.p = n
e.x = n
k.q = e
k.s = m
n.o = e
n.t = b
i.w = e
i.p = l
assert j.w.u.o.s.y.u.o.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.w: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.z: J = None
        self.r: E = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: I = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: E = None
        self.t: J = None
        self.p: I = None
        self.x: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: E = None
        self.txt = txt

f = A("f")
a = B("a")
b = C("b")
m = D("m")
l = E("l")
j = F("j")
e = G("e")
k = H("k")
n = I("n")
i = J("i")

f.y = m
f.s = b
f.w = i
a.r = m
a.u = i
b.s = a
b.u = f
b.y = f
b.z = i
b.r = l
m.u = n
l.r = a
l.z = n
l.w = f
j.w = m
e.s = f
e.q = l
e.t = i
e.p = n
e.x = n
k.q = e
k.s = m
n.o = e
n.t = b
i.w = e
i.p = l
assert j.w.u.o.s.y.u.o.x.o.txt == "e"