class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.q: C = None
        self.txt = txt

k = A("k")
n = B("n")
f = C("f")
b = D("b")
a = E("a")
j = A("j")
m = C("m")
g = D("g")
d = D("d")

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: D = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: A = None
        self.q: C = None
        self.txt = txt

k = A("k")
n = B("n")
f = C("f")
b = D("b")
a = E("a")
j = A("j")
m = C("m")
g = D("g")
d = D("d")

k.x = g
k.z = f
n.y = m
n.x = f
f.q = m
f.u = m
f.o = j
b.u = g
b.s = d
b.q = f
b.p = f
a.u = n
a.t = j
a.q = f
j.x = g
j.z = m
m.q = f
m.u = f
m.o = j
g.u = d
g.s = b
g.q = f
g.p = m
d.u = g
d.s = b
d.q = m
d.p = m
assert a.u.y.o.txt == "j"