class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: F = None
        self.o: G = None
        self.z: C = None
        self.r: C = None
        self.y: G = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: F = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: A = None
        self.s: C = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: F = None
        self.w: E = None
        self.txt = txt

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

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