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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: A = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.v: D = None
        self.s: E = None
        self.o: D = None
        self.y: G = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: A = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: A = None
        self.v: D = None
        self.s: E = None
        self.o: D = None
        self.y: G = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

n.x = l
n.o = k
f.s = k
f.x = n
f.r = n
d.t = k
d.s = k
d.z = n
d.v = e
d.o = e
d.y = c
d.u = l
e.z = d
e.q = k
e.u = n
e.s = c
k.t = e
l.v = e
l.y = e
l.w = n
l.z = n
c.v = d
assert n.x.z.x.v.q.txt == "k"