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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.q: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.v: G = None
        self.x: G = None
        self.w: B = None
        self.txt = txt

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

a = A("a")
b = B("b")
k = C("k")
n = D("n")
j = E("j")
l = F("l")
g = G("g")
f = A("f")
d = F("d")
e = G("e")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.q: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: C = None
        self.v: G = None
        self.x: G = None
        self.w: B = None
        self.txt = txt

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

a = A("a")
b = B("b")
k = C("k")
n = D("n")
j = E("j")
l = F("l")
g = G("g")
f = A("f")
d = F("d")
e = G("e")

a.x = n
a.y = b
a.u = e
b.v = k
b.z = d
b.q = n
k.o = b
k.x = a
k.q = n
n.u = f
n.t = b
j.s = b
l.t = d
l.q = k
l.v = g
l.x = e
l.w = b
g.x = l
g.w = n
g.o = k
f.x = n
f.y = b
f.u = g
d.t = l
d.q = k
d.v = g
d.x = g
d.w = b
e.x = l
e.w = n
e.o = k
assert d.w.v.x.x.txt == "n"