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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

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

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

l.t = a
l.v = d
l.r = e
c.v = k
c.r = f
c.q = e
c.y = l
c.x = j
d.z = c
d.q = c
d.t = c
d.v = c
j.v = e
g.x = j
g.p = j
g.r = c
k.x = j
k.p = j
k.r = c
a.x = j
a.p = j
a.r = c
e.t = k
e.v = d
e.r = l
f.z = c
f.q = c
f.t = c
f.v = c
assert j.v.r.v.t.q.txt == "e"