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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: E = None
        self.u: B = None
        self.w: B = None
        self.v: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: E = None
        self.u: B = None
        self.w: B = None
        self.v: A = None
        self.txt = txt

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

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

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