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

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

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

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

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

i = A("i")
k = B("k")
a = C("a")
m = D("m")
j = E("j")
c = E("c")
l = C("l")
e = E("e")
g = B("g")
f = E("f")

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

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

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

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

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

i = A("i")
k = B("k")
a = C("a")
m = D("m")
j = E("j")
c = E("c")
l = C("l")
e = E("e")
g = B("g")
f = E("f")

i.x = l
k.x = l
k.u = i
k.r = f
a.q = l
a.o = m
a.s = i
a.p = k
m.v = k
j.y = m
j.t = m
j.z = m
c.y = m
c.t = m
c.z = m
l.q = a
l.o = m
l.s = i
l.p = g
e.y = m
e.t = m
e.z = m
g.x = l
g.u = i
g.r = c
f.y = m
f.t = m
f.z = m
assert m.v.u.x.q.q.p.txt == "g"