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

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

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

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

h = A("h")
n = B("n")
g = C("g")
k = D("k")
l = A("l")
d = B("d")
c = B("c")

h.w = k
h.q = g
h.x = g
h.u = l
n.x = k
n.y = k
n.v = l
n.q = l
g.p = l
g.z = l
g.w = c
g.s = k
k.y = g
k.v = g
k.q = h
l.w = k
l.q = g
l.x = g
l.u = h
d.x = k
d.y = k
d.v = h
d.q = l
c.x = k
c.y = k
c.v = l
c.q = h
assert h.w.v.s.q.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

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

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

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

h = A("h")
n = B("n")
g = C("g")
k = D("k")
l = A("l")
d = B("d")
c = B("c")

h.w = k
h.q = g
h.x = g
h.u = l
n.x = k
n.y = k
n.v = l
n.q = l
g.p = l
g.z = l
g.w = c
g.s = k
k.y = g
k.v = g
k.q = h
l.w = k
l.q = g
l.x = g
l.u = h
d.x = k
d.y = k
d.v = h
d.q = l
c.x = k
c.y = k
c.v = l
c.q = h
assert h.w.v.s.q.u.u.txt == "h"