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

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

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

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

c = A("c")
a = B("a")
b = C("b")
g = D("g")
i = D("i")
j = D("j")
e = C("e")
l = B("l")
n = D("n")
f = A("f")

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

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

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

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

c = A("c")
a = B("a")
b = C("b")
g = D("g")
i = D("i")
j = D("j")
e = C("e")
l = B("l")
n = D("n")
f = A("f")

c.t = f
c.q = e
c.w = l
c.p = b
a.y = j
a.o = c
b.r = e
b.z = e
b.u = l
b.y = a
g.w = e
g.x = a
g.s = a
g.o = b
i.w = b
i.x = l
i.s = a
i.o = e
j.w = b
j.x = l
j.s = a
j.o = e
e.r = b
e.z = b
e.u = a
e.y = a
l.y = n
l.o = f
n.w = b
n.x = a
n.s = l
n.o = e
f.t = c
f.q = b
f.w = a
f.p = e
assert n.w.y.o.p.r.txt == "e"