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

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

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

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

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

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

a = A("a")
j = B("j")
c = C("c")
f = D("f")
l = E("l")
b = F("b")

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

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

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

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

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

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

a = A("a")
j = B("j")
c = C("c")
f = D("f")
l = E("l")
b = F("b")

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