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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: C = None
        self.r: D = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

l = A("l")
e = B("e")
b = C("b")
n = D("n")
a = E("a")
g = F("g")

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: C = None
        self.r: D = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

l = A("l")
e = B("e")
b = C("b")
n = D("n")
a = E("a")
g = F("g")

l.x = e
e.v = n
e.y = a
b.z = l
b.o = l
b.w = l
b.v = g
b.y = g
n.x = g
n.v = a
n.u = a
a.q = b
g.w = e
g.t = b
g.r = n
g.x = n
g.o = a
assert a.q.v.x.txt == "n"