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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.p: E = None
        self.txt = txt

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

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