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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.t: G = None
        self.p: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: D = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: F = None
        self.t: G = None
        self.p: G = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: D = None
        self.z: D = None
        self.txt = txt

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

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

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