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

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

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

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

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

g.y = b
g.q = c
g.r = n
m.w = n
j.p = a
j.w = a
j.u = m
j.t = g
f.o = a
n.y = f
n.q = l
n.r = g
b.o = a
c.w = n
h.w = n
a.p = j
a.w = j
a.u = c
a.t = n
l.w = g
assert n.q.w.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: B = None
        self.r: A = None
        self.txt = txt

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

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

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

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

g.y = b
g.q = c
g.r = n
m.w = n
j.p = a
j.w = a
j.u = m
j.t = g
f.o = a
n.y = f
n.q = l
n.r = g
b.o = a
c.w = n
h.w = n
a.p = j
a.w = j
a.u = c
a.t = n
l.w = g
assert n.q.w.y.o.txt == "a"