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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: H = None
        self.y: F = None
        self.r: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: F = None
        self.t: A = None
        self.v: G = None
        self.s: B = None
        self.w: B = None
        self.u: F = None
        self.txt = txt

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

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

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

i = A("i")
e = B("e")
h = C("h")
b = D("b")
m = E("m")
g = F("g")
f = G("f")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: H = None
        self.y: F = None
        self.r: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: F = None
        self.t: A = None
        self.v: G = None
        self.s: B = None
        self.w: B = None
        self.u: F = None
        self.txt = txt

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

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

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

i = A("i")
e = B("e")
h = C("h")
b = D("b")
m = E("m")
g = F("g")
f = G("f")
k = H("k")

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