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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: B = None
        self.x: F = None
        self.z: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: B = None
        self.x: F = None
        self.z: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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