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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.txt = txt

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

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

a = A("a")
f = B("f")
c = C("c")
i = D("i")
l = E("l")
d = F("d")

a.v = f
a.q = i
f.o = d
f.w = l
c.v = i
c.p = i
c.q = a
c.t = d
i.r = f
i.p = a
l.u = f
d.o = l
d.v = a
d.q = f
assert d.v.q.r.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.txt = txt

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

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

a = A("a")
f = B("f")
c = C("c")
i = D("i")
l = E("l")
d = F("d")

a.v = f
a.q = i
f.o = d
f.w = l
c.v = i
c.p = i
c.q = a
c.t = d
i.r = f
i.p = a
l.u = f
d.o = l
d.v = a
d.q = f
assert d.v.q.r.o.q.txt == "f"