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

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

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

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

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

c.t = i
c.s = n
c.x = e
c.p = e
m.w = e
m.p = e
m.q = d
n.x = m
n.o = k
n.u = e
d.p = i
d.r = i
d.t = k
d.q = n
i.t = c
i.s = n
i.x = m
i.p = e
k.p = c
k.r = c
k.t = d
k.q = l
e.w = m
e.p = m
e.q = d
l.x = e
l.o = k
l.u = m
assert n.u.q.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: C = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

c.t = i
c.s = n
c.x = e
c.p = e
m.w = e
m.p = e
m.q = d
n.x = m
n.o = k
n.u = e
d.p = i
d.r = i
d.t = k
d.q = n
i.t = c
i.s = n
i.x = m
i.p = e
k.p = c
k.r = c
k.t = d
k.q = l
e.w = m
e.p = m
e.q = d
l.x = e
l.o = k
l.u = m
assert n.u.q.q.x.txt == "m"