class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.t: B = None
        self.txt = txt

k = A("k")
l = B("l")
m = C("m")
h = D("h")
e = E("e")
b = E("b")
f = A("f")
n = D("n")
a = C("a")
c = D("c")

k.x = b
k.p = l
k.s = h
l.t = h
l.v = b
m.r = k
m.z = a
m.x = a
m.q = a
m.o = f
h.r = l
h.u = c
e.s = l
e.t = l
e.v = f
b.s = l
b.t = l
b.v = f
f.x = e
f.p = l
f.s = n
n.r = l
n.u = c
a.r = k
a.o = k
a.z = m
a.x = m
a.q = m
c.r = l
c.u = h
assert n.u.u.r.t.u.r.v.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.t: B = None
        self.txt = txt

k = A("k")
l = B("l")
m = C("m")
h = D("h")
e = E("e")
b = E("b")
f = A("f")
n = D("n")
a = C("a")
c = D("c")

k.x = b
k.p = l
k.s = h
l.t = h
l.v = b
m.r = k
m.z = a
m.x = a
m.q = a
m.o = f
h.r = l
h.u = c
e.s = l
e.t = l
e.v = f
b.s = l
b.t = l
b.v = f
f.x = e
f.p = l
f.s = n
n.r = l
n.u = c
a.r = k
a.o = k
a.z = m
a.x = m
a.q = m
c.r = l
c.u = h
assert n.u.u.r.t.u.r.v.v.x.txt == "e"