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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.u: A = None
        self.v: G = None
        self.s: A = None
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: E = None
        self.r: H = None
        self.w: G = None
        self.x: C = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.u: A = None
        self.v: G = None
        self.s: A = None
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: E = None
        self.r: H = None
        self.w: G = None
        self.x: C = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

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

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

m.v = h
m.w = k
b.v = g
b.t = g
l.x = k
l.p = h
l.u = m
l.s = m
l.v = j
l.q = a
a.o = d
k.t = a
k.w = m
k.v = m
k.u = h
k.s = j
h.s = b
j.u = b
j.p = k
j.r = g
j.w = d
j.x = l
j.q = l
j.v = a
g.t = m
d.u = b
d.p = k
d.r = g
d.w = j
d.x = l
d.q = l
d.v = a
assert h.s.t.t.v.s.t.t.v.s.txt == "b"