class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: G = None
        self.y: G = None
        self.q: B = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: C = None
        self.w: E = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.w: C = None
        self.t: F = None
        self.txt = txt

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

m.o = k
m.v = b
m.y = b
m.q = a
m.z = g
a.z = b
a.p = h
a.q = h
j.o = a
h.p = a
h.v = j
h.w = e
h.z = b
e.w = a
e.s = h
e.t = k
e.r = k
k.t = h
b.z = j
b.w = j
b.p = m
b.t = k
g.w = a
g.s = h
g.t = k
g.r = k
assert h.z.p.q.q.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: G = None
        self.y: G = None
        self.q: B = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: D = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: C = None
        self.w: E = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: A = None
        self.w: C = None
        self.t: F = None
        self.txt = txt

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

m.o = k
m.v = b
m.y = b
m.q = a
m.z = g
a.z = b
a.p = h
a.q = h
j.o = a
h.p = a
h.v = j
h.w = e
h.z = b
e.w = a
e.s = h
e.t = k
e.r = k
k.t = h
b.z = j
b.w = j
b.p = m
b.t = k
g.w = a
g.s = h
g.t = k
g.r = k
assert h.z.p.q.q.w.s.txt == "h"