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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.p: F = None
        self.z: G = None
        self.t: G = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: D = None
        self.q: D = None
        self.u: G = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.p: F = None
        self.z: G = None
        self.t: G = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: D = None
        self.q: D = None
        self.u: G = None
        self.z: A = None
        self.txt = txt

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

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

e.q = n
e.v = b
e.w = i
a.z = i
i.q = h
i.z = h
i.t = h
i.x = b
i.p = k
i.o = g
b.p = e
g.t = i
k.x = n
k.w = b
k.q = b
k.u = h
k.z = e
h.s = n
n.x = k
n.w = b
n.q = b
n.u = h
n.z = e
assert g.t.x.p.v.p.v.p.q.txt == "n"