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

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

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

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

d = A("d")
n = B("n")
j = C("j")
g = D("g")
a = B("a")
l = B("l")
b = D("b")
h = B("h")

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

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

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

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

d = A("d")
n = B("n")
j = C("j")
g = D("g")
a = B("a")
l = B("l")
b = D("b")
h = B("h")

d.w = b
d.x = a
n.u = b
n.o = b
n.t = d
n.r = l
j.y = a
j.t = l
j.q = d
j.o = h
g.v = b
g.q = j
g.x = a
g.s = h
a.u = b
a.t = d
a.o = g
a.r = h
l.u = b
l.t = d
l.o = g
l.r = n
b.v = g
b.q = j
b.x = h
b.s = l
h.u = g
h.t = d
h.o = b
h.r = l
assert a.u.q.o.u.s.txt == "h"