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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

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

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

g = A("g")
e = B("e")
m = C("m")
n = D("n")
a = E("a")
h = C("h")
d = A("d")
k = D("k")

g.w = m
g.v = h
g.u = k
g.x = a
e.u = h
e.q = a
e.s = a
m.s = k
m.w = k
m.x = h
m.p = e
n.q = e
n.o = a
a.t = e
a.q = e
a.s = n
a.w = n
a.r = g
h.s = k
h.x = m
h.w = n
h.p = e
d.w = h
d.v = m
d.u = n
d.x = a
k.q = e
k.o = a
assert d.x.q.s.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: C = None
        self.u: D = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

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

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

g = A("g")
e = B("e")
m = C("m")
n = D("n")
a = E("a")
h = C("h")
d = A("d")
k = D("k")

g.w = m
g.v = h
g.u = k
g.x = a
e.u = h
e.q = a
e.s = a
m.s = k
m.w = k
m.x = h
m.p = e
n.q = e
n.o = a
a.t = e
a.q = e
a.s = n
a.w = n
a.r = g
h.s = k
h.x = m
h.w = n
h.p = e
d.w = h
d.v = m
d.u = n
d.x = a
k.q = e
k.o = a
assert d.x.q.s.t.u.txt == "h"