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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: F = None
        self.y: B = None
        self.x: C = None
        self.w: B = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: F = None
        self.y: B = None
        self.x: C = None
        self.w: B = None
        self.o: C = None
        self.txt = txt

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

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

g.o = b
m.v = a
m.s = a
m.q = a
m.r = d
m.y = l
a.u = d
a.s = d
a.x = e
a.z = e
d.u = l
e.p = m
e.y = m
e.w = m
e.v = l
e.x = a
e.o = a
l.x = a
l.q = g
l.z = d
l.s = d
l.p = d
l.r = m
b.o = g
assert m.q.x.v.x.txt == "a"