class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

a = A("a")
l = B("l")
b = C("b")
n = D("n")
m = E("m")
c = F("c")

a.r = b
a.s = m
l.o = c
l.p = c
b.s = l
b.t = n
b.q = m
b.o = c
b.x = a
n.y = l
n.v = l
n.o = l
n.r = m
n.s = m
n.t = b
m.o = l
c.v = b
assert l.o.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

a = A("a")
l = B("l")
b = C("b")
n = D("n")
m = E("m")
c = F("c")

a.r = b
a.s = m
l.o = c
l.p = c
b.s = l
b.t = n
b.q = m
b.o = c
b.x = a
n.y = l
n.v = l
n.o = l
n.r = m
n.s = m
n.t = b
m.o = l
c.v = b
assert l.o.v.t.txt == "n"