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

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

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

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

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

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

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

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

b.x = n
k.v = b
k.y = b
k.z = n
k.p = n
k.x = e
j.s = b
j.y = b
j.x = e
j.z = n
j.u = d
j.q = k
d.o = b
d.u = c
e.u = b
e.s = d
e.o = j
c.t = k
c.r = b
n.z = c
n.s = e
n.u = j
n.o = j
n.v = b
assert n.s.o.u.o.x.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

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

b.x = n
k.v = b
k.y = b
k.z = n
k.p = n
k.x = e
j.s = b
j.y = b
j.x = e
j.z = n
j.u = d
j.q = k
d.o = b
d.u = c
e.u = b
e.s = d
e.o = j
c.t = k
c.r = b
n.z = c
n.s = e
n.u = j
n.o = j
n.v = b
assert n.s.o.u.o.x.v.x.txt == "n"