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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

i.u = d
i.t = g
i.q = b
d.x = b
d.y = h
d.w = i
k.s = g
k.o = n
k.z = c
g.o = d
b.x = c
b.w = k
b.p = k
c.s = g
c.o = n
c.z = k
n.s = g
n.o = k
n.z = k
e.u = h
e.t = g
e.q = b
h.x = b
h.y = d
h.w = e
assert b.w.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

i.u = d
i.t = g
i.q = b
d.x = b
d.y = h
d.w = i
k.s = g
k.o = n
k.z = c
g.o = d
b.x = c
b.w = k
b.p = k
c.s = g
c.o = n
c.z = k
n.s = g
n.o = k
n.z = k
e.u = h
e.t = g
e.q = b
h.x = b
h.y = d
h.w = e
assert b.w.o.s.txt == "g"