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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.x: D = None
        self.r: A = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.w: D = None
        self.s: E = None
        self.q: F = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.x: D = None
        self.r: A = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: F = None
        self.w: D = None
        self.s: E = None
        self.q: F = None
        self.z: A = None
        self.txt = txt

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

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

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