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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: A = None
        self.t: A = None
        self.v: C = None
        self.txt = txt

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

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

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

i.z = e
i.v = b
k.w = m
j.y = k
j.w = i
j.t = m
j.v = d
c.t = e
c.u = b
c.p = b
e.u = j
f.z = e
f.v = c
b.t = e
b.u = c
b.p = c
m.z = e
m.v = c
d.y = g
d.w = i
d.t = m
d.v = j
g.w = m
assert m.v.u.t.u.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: A = None
        self.t: A = None
        self.v: C = None
        self.txt = txt

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

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

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

i.z = e
i.v = b
k.w = m
j.y = k
j.w = i
j.t = m
j.v = d
c.t = e
c.u = b
c.p = b
e.u = j
f.z = e
f.v = c
b.t = e
b.u = c
b.p = c
m.z = e
m.v = c
d.y = g
d.w = i
d.t = m
d.v = j
g.w = m
assert m.v.u.t.u.t.v.txt == "c"