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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: F = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.p: A = None
        self.y: B = None
        self.txt = txt

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

k.o = f
k.u = i
a.p = k
b.v = i
e.z = a
e.t = a
f.q = i
f.t = i
f.x = b
f.z = b
i.t = k
i.p = k
i.z = b
i.y = a
assert e.t.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: F = None
        self.x: C = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: C = None
        self.p: A = None
        self.y: B = None
        self.txt = txt

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

k.o = f
k.u = i
a.p = k
b.v = i
e.z = a
e.t = a
f.q = i
f.t = i
f.x = b
f.z = b
i.t = k
i.p = k
i.z = b
i.y = a
assert e.t.p.u.txt == "i"