class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: C = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

b.t = l
b.y = l
b.u = h
b.p = h
k.p = a
k.t = e
k.x = h
k.u = l
k.o = b
l.s = b
l.y = k
l.t = e
l.x = e
e.v = a
e.u = f
h.w = d
f.p = e
f.t = m
f.x = h
f.u = l
f.o = b
g.p = a
g.t = m
g.x = h
g.u = d
g.o = b
d.s = b
d.y = k
d.t = m
d.x = a
a.v = e
a.u = g
m.v = a
m.u = g
assert b.u.w.s.u.w.txt == "d"