class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: E = None
        self.t: H = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: B = None
        self.x: H = None
        self.s: E = None
        self.o: C = None
        self.y: C = None
        self.p: B = None
        self.txt = txt

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

b = A("b")
n = B("n")
i = C("i")
m = D("m")
h = E("h")
l = F("l")
e = G("e")
d = H("d")

b.w = e
b.q = e
b.v = n
n.r = b
n.p = b
n.y = h
n.t = d
i.o = e
i.x = h
m.s = l
m.u = h
m.r = h
m.t = h
h.y = n
h.q = d
l.s = b
e.z = d
e.x = d
e.r = n
e.p = n
e.s = h
e.o = i
e.y = i
d.s = h
d.u = h
d.r = n
assert n.t.r.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: E = None
        self.t: H = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: B = None
        self.x: H = None
        self.s: E = None
        self.o: C = None
        self.y: C = None
        self.p: B = None
        self.txt = txt

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

b = A("b")
n = B("n")
i = C("i")
m = D("m")
h = E("h")
l = F("l")
e = G("e")
d = H("d")

b.w = e
b.q = e
b.v = n
n.r = b
n.p = b
n.y = h
n.t = d
i.o = e
i.x = h
m.s = l
m.u = h
m.r = h
m.t = h
h.y = n
h.q = d
l.s = b
e.z = d
e.x = d
e.r = n
e.p = n
e.s = h
e.o = i
e.y = i
d.s = h
d.u = h
d.r = n
assert n.t.r.t.u.txt == "h"