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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: B = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.txt = txt

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

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

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

m = A("m")
a = B("a")
n = C("n")
f = D("f")
h = E("h")
b = F("b")
e = G("e")
k = H("k")
c = A("c")

m.v = b
m.p = n
m.o = n
a.w = b
a.s = f
n.u = e
n.w = m
f.o = a
f.s = a
f.p = n
f.z = n
h.z = e
h.t = a
b.q = e
e.o = a
e.t = c
e.u = k
e.s = f
e.q = h
e.w = b
e.v = n
k.v = b
k.z = b
k.t = h
k.s = c
k.y = a
k.x = n
k.w = n
c.v = b
c.p = n
c.o = n
assert c.v.q.t.v.q.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: C = None
        self.o: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: B = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.txt = txt

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

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

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

m = A("m")
a = B("a")
n = C("n")
f = D("f")
h = E("h")
b = F("b")
e = G("e")
k = H("k")
c = A("c")

m.v = b
m.p = n
m.o = n
a.w = b
a.s = f
n.u = e
n.w = m
f.o = a
f.s = a
f.p = n
f.z = n
h.z = e
h.t = a
b.q = e
e.o = a
e.t = c
e.u = k
e.s = f
e.q = h
e.w = b
e.v = n
k.v = b
k.z = b
k.t = h
k.s = c
k.y = a
k.x = n
k.w = n
c.v = b
c.p = n
c.o = n
assert c.v.q.t.v.q.q.t.txt == "a"