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

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

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

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

b = A("b")
k = B("k")
c = C("c")
h = D("h")
n = C("n")
j = D("j")
g = B("g")
e = A("e")

b.w = g
b.z = g
b.u = c
k.x = g
k.y = c
k.u = j
c.t = b
c.v = e
h.y = j
h.q = g
h.t = b
n.t = e
n.v = e
j.y = h
j.q = k
j.t = b
g.x = k
g.y = n
g.u = j
e.w = k
e.z = k
e.u = n
assert g.x.x.u.q.x.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

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

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

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

b = A("b")
k = B("k")
c = C("c")
h = D("h")
n = C("n")
j = D("j")
g = B("g")
e = A("e")

b.w = g
b.z = g
b.u = c
k.x = g
k.y = c
k.u = j
c.t = b
c.v = e
h.y = j
h.q = g
h.t = b
n.t = e
n.v = e
j.y = h
j.q = k
j.t = b
g.x = k
g.y = n
g.u = j
e.w = k
e.z = k
e.u = n
assert g.x.x.u.q.x.y.v.txt == "e"