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

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

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

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

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

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

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

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

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

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

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

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

b.y = a
b.t = e
b.r = c
b.q = c
b.s = l
e.x = a
e.w = i
f.r = e
m.r = j
a.z = e
l.r = e
j.r = e
c.y = a
c.t = e
c.r = b
c.q = b
c.s = j
d.r = l
i.r = j
assert j.r.w.r.r.x.z.x.z.x.txt == "a"