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

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

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

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

c = A("c")
e = B("e")
l = C("l")
j = D("j")
m = D("m")
a = C("a")
i = C("i")
d = A("d")

c.q = j
c.t = d
e.s = j
e.t = j
e.p = d
l.r = m
l.u = a
j.o = m
j.y = a
j.w = d
j.u = d
m.o = j
m.y = l
m.w = d
m.u = c
a.r = j
a.u = i
i.r = j
i.u = a
d.q = m
d.t = c
assert c.q.o.w.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: A = None
        self.txt = txt

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

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

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

c = A("c")
e = B("e")
l = C("l")
j = D("j")
m = D("m")
a = C("a")
i = C("i")
d = A("d")

c.q = j
c.t = d
e.s = j
e.t = j
e.p = d
l.r = m
l.u = a
j.o = m
j.y = a
j.w = d
j.u = d
m.o = j
m.y = l
m.w = d
m.u = c
a.r = j
a.u = i
i.r = j
i.u = a
d.q = m
d.t = c
assert c.q.o.w.t.q.txt == "j"