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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: H = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

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

g = A("g")
n = B("n")
b = C("b")
j = D("j")
a = E("a")
f = F("f")
k = G("k")
h = H("h")
m = D("m")

g.u = b
g.t = j
n.w = j
n.s = j
b.p = a
j.s = n
j.o = g
j.u = m
a.o = k
f.w = g
k.z = n
k.t = h
k.s = g
k.p = b
h.r = b
h.s = m
m.s = n
m.o = g
m.u = j
assert j.u.s.w.o.u.p.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: H = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

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

g = A("g")
n = B("n")
b = C("b")
j = D("j")
a = E("a")
f = F("f")
k = G("k")
h = H("h")
m = D("m")

g.u = b
g.t = j
n.w = j
n.s = j
b.p = a
j.s = n
j.o = g
j.u = m
a.o = k
f.w = g
k.z = n
k.t = h
k.s = g
k.p = b
h.r = b
h.s = m
m.s = n
m.o = g
m.u = j
assert j.u.s.w.o.u.p.o.p.txt == "b"