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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.txt = txt

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

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