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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.t: G = None
        self.o: C = None
        self.s: C = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.t: G = None
        self.o: C = None
        self.s: C = None
        self.x: G = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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