class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.v: C = None
        self.x: C = None
        self.o: B = None
        self.s: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: F = None
        self.txt = txt

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

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

f.u = m
f.p = m
f.v = l
f.x = l
f.o = g
f.s = a
g.r = f
g.q = f
g.v = l
l.r = m
l.s = g
l.w = a
l.u = a
l.q = f
m.w = c
m.t = f
m.r = a
m.x = a
c.q = m
c.w = a
a.s = f
assert g.v.q.s.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.v: C = None
        self.x: C = None
        self.o: B = None
        self.s: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: F = None
        self.txt = txt

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

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

f.u = m
f.p = m
f.v = l
f.x = l
f.o = g
f.s = a
g.r = f
g.q = f
g.v = l
l.r = m
l.s = g
l.w = a
l.u = a
l.q = f
m.w = c
m.t = f
m.r = a
m.x = a
c.q = m
c.w = a
a.s = f
assert g.v.q.s.s.v.txt == "l"