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

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

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

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

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

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

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

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

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

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

a.x = f
a.q = l
a.s = l
a.p = n
n.r = e
n.v = e
n.t = c
n.p = c
f.s = e
f.u = c
e.z = b
e.x = c
b.r = e
b.v = e
b.t = c
b.p = a
l.s = e
l.u = c
j.s = e
j.u = c
c.x = l
c.s = l
c.q = j
c.p = b
assert e.x.p.p.p.p.p.txt == "b"