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

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

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

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

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

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

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

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

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

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

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

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

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