class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: F = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

k.r = b
k.o = b
k.y = l
e.v = l
d.p = e
d.y = b
d.w = b
d.o = l
l.s = i
l.v = k
l.t = k
l.u = k
l.q = b
f.p = b
b.s = k
b.r = f
i.p = e
i.y = b
i.w = b
i.o = l
assert e.v.t.r.s.y.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: F = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

k.r = b
k.o = b
k.y = l
e.v = l
d.p = e
d.y = b
d.w = b
d.o = l
l.s = i
l.v = k
l.t = k
l.u = k
l.q = b
f.p = b
b.s = k
b.r = f
i.p = e
i.y = b
i.w = b
i.o = l
assert e.v.t.r.s.y.q.r.txt == "f"