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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.x: B = None
        self.y: A = None
        self.t: A = None
        self.z: C = None
        self.p: B = None
        self.u: A = None
        self.txt = txt

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

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

g.s = f
g.v = d
g.u = m
g.t = c
g.o = c
g.q = h
g.p = h
a.w = m
c.v = j
d.x = g
d.y = j
h.v = d
h.u = f
h.y = f
h.s = m
m.y = l
f.q = d
f.s = m
f.x = a
f.p = a
f.y = g
f.t = g
f.u = g
f.z = c
j.r = m
l.w = m
assert m.y.w.y.w.y.w.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: D = None
        self.u: F = None
        self.t: C = None
        self.q: E = None
        self.p: E = None
        self.o: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.x: B = None
        self.y: A = None
        self.t: A = None
        self.z: C = None
        self.p: B = None
        self.u: A = None
        self.txt = txt

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

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

g.s = f
g.v = d
g.u = m
g.t = c
g.o = c
g.q = h
g.p = h
a.w = m
c.v = j
d.x = g
d.y = j
h.v = d
h.u = f
h.y = f
h.s = m
m.y = l
f.q = d
f.s = m
f.x = a
f.p = a
f.y = g
f.t = g
f.u = g
f.z = c
j.r = m
l.w = m
assert m.y.w.y.w.y.w.y.w.txt == "m"