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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

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

e.x = g
e.q = d
j.t = a
j.w = a
j.u = g
j.s = g
j.y = e
l.t = j
l.r = k
d.o = h
d.r = l
d.u = e
d.q = j
b.s = e
b.r = j
b.p = l
b.z = a
a.o = b
a.r = g
a.u = e
a.q = j
k.s = e
k.r = j
k.p = l
k.z = a
h.s = e
h.r = j
h.p = g
h.z = a
g.t = j
g.r = h
assert k.p.t.y.q.q.w.r.r.txt == "h"