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

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

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

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

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

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

f = A("f")
e = B("e")
i = C("i")
k = D("k")
d = E("d")
a = F("a")

f.t = k
f.w = k
f.v = d
e.x = f
e.o = d
e.v = i
e.w = k
e.p = a
i.w = f
i.v = f
i.x = d
k.v = f
k.o = a
k.q = e
d.v = k
d.q = f
d.r = i
a.s = d
assert a.s.r.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

f = A("f")
e = B("e")
i = C("i")
k = D("k")
d = E("d")
a = F("a")

f.t = k
f.w = k
f.v = d
e.x = f
e.o = d
e.v = i
e.w = k
e.p = a
i.w = f
i.v = f
i.x = d
k.v = f
k.o = a
k.q = e
d.v = k
d.q = f
d.r = i
a.s = d
assert a.s.r.v.v.v.v.txt == "f"