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

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

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

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

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

i = A("i")
d = B("d")
j = C("j")
a = D("a")
b = E("b")
n = B("n")
h = C("h")
f = B("f")
k = E("k")
c = A("c")

i.t = h
d.w = k
d.q = k
d.u = f
d.r = a
j.s = c
j.x = i
j.p = d
a.w = f
b.z = i
b.v = h
b.o = j
b.q = a
n.w = k
n.q = k
n.u = d
n.r = a
h.s = c
h.x = i
h.p = f
f.w = k
f.u = n
f.r = a
f.q = b
k.z = c
k.v = j
k.o = h
k.q = a
c.t = j
assert d.r.w.w.q.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

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

i = A("i")
d = B("d")
j = C("j")
a = D("a")
b = E("b")
n = B("n")
h = C("h")
f = B("f")
k = E("k")
c = A("c")

i.t = h
d.w = k
d.q = k
d.u = f
d.r = a
j.s = c
j.x = i
j.p = d
a.w = f
b.z = i
b.v = h
b.o = j
b.q = a
n.w = k
n.q = k
n.u = d
n.r = a
h.s = c
h.x = i
h.p = f
f.w = k
f.u = n
f.r = a
f.q = b
k.z = c
k.v = j
k.o = h
k.q = a
c.t = j
assert d.r.w.w.q.w.q.txt == "b"