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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: A = None
        self.o: G = None
        self.r: G = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: B = None
        self.y: G = None
        self.p: D = None
        self.r: G = None
        self.z: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

n = A("n")
j = B("j")
i = C("i")
k = D("k")
g = E("g")
m = F("m")
e = G("e")

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: A = None
        self.o: G = None
        self.r: G = None
        self.v: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: B = None
        self.y: G = None
        self.p: D = None
        self.r: G = None
        self.z: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

n = A("n")
j = B("j")
i = C("i")
k = D("k")
g = E("g")
m = F("m")
e = G("e")

n.t = k
n.r = i
n.z = m
n.p = m
n.q = g
j.p = m
j.v = m
j.t = n
j.o = e
j.r = e
i.p = e
i.z = j
i.w = k
k.s = n
k.v = i
g.u = e
g.y = e
g.r = e
g.x = j
g.p = k
g.z = m
g.v = n
m.x = g
e.y = g
e.x = i
e.p = n
assert j.o.p.q.v.t.v.txt == "i"