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

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

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

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

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

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

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

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

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

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

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

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

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