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

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

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

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

b = A("b")
i = B("i")
l = C("l")
d = D("d")
c = C("c")
n = D("n")
k = D("k")
a = C("a")
e = D("e")

b.p = e
b.x = n
b.q = i
b.w = i
i.y = d
i.x = b
i.q = b
i.t = n
l.o = k
l.t = d
l.v = c
d.y = c
d.t = b
c.o = n
c.t = k
c.v = a
n.y = l
n.t = b
k.y = a
k.t = b
a.o = k
a.t = n
a.v = c
e.y = l
e.t = b
assert e.t.x.y.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: D = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

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

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

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

b = A("b")
i = B("i")
l = C("l")
d = D("d")
c = C("c")
n = D("n")
k = D("k")
a = C("a")
e = D("e")

b.p = e
b.x = n
b.q = i
b.w = i
i.y = d
i.x = b
i.q = b
i.t = n
l.o = k
l.t = d
l.v = c
d.y = c
d.t = b
c.o = n
c.t = k
c.v = a
n.y = l
n.t = b
k.y = a
k.t = b
a.o = k
a.t = n
a.v = c
e.y = l
e.t = b
assert e.t.x.y.t.y.t.txt == "k"