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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

l = A("l")
h = B("h")
n = C("n")
k = D("k")
e = E("e")
j = C("j")
b = A("b")
d = A("d")
g = E("g")

l.u = n
l.s = d
l.t = h
l.w = h
h.z = g
h.u = b
n.x = b
n.u = j
k.s = g
k.t = d
e.x = k
e.t = d
e.o = h
e.p = n
j.x = l
j.u = n
b.u = j
b.s = d
b.t = h
b.w = h
d.u = n
d.s = l
d.t = h
d.w = h
g.x = k
g.t = l
g.o = h
g.p = j
assert g.p.x.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.t: B = None
        self.w: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: A = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

l = A("l")
h = B("h")
n = C("n")
k = D("k")
e = E("e")
j = C("j")
b = A("b")
d = A("d")
g = E("g")

l.u = n
l.s = d
l.t = h
l.w = h
h.z = g
h.u = b
n.x = b
n.u = j
k.s = g
k.t = d
e.x = k
e.t = d
e.o = h
e.p = n
j.x = l
j.u = n
b.u = j
b.s = d
b.t = h
b.w = h
d.u = n
d.s = l
d.t = h
d.w = h
g.x = k
g.t = l
g.o = h
g.p = j
assert g.p.x.s.w.txt == "h"