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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: F = None
        self.o: D = None
        self.x: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

f = A("f")
h = B("h")
k = C("k")
g = D("g")
l = E("l")
m = F("m")
i = A("i")

f.t = k
f.y = i
f.x = g
f.p = m
f.v = l
h.s = m
k.r = m
k.q = m
k.o = g
k.z = g
k.x = i
g.u = i
l.v = k
l.x = k
l.t = g
l.y = h
m.o = f
i.t = k
i.y = f
i.x = g
i.p = m
i.v = l
assert k.x.t.x.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: A = None
        self.x: D = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: F = None
        self.o: D = None
        self.x: A = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

f = A("f")
h = B("h")
k = C("k")
g = D("g")
l = E("l")
m = F("m")
i = A("i")

f.t = k
f.y = i
f.x = g
f.p = m
f.v = l
h.s = m
k.r = m
k.q = m
k.o = g
k.z = g
k.x = i
g.u = i
l.v = k
l.x = k
l.t = g
l.y = h
m.o = f
i.t = k
i.y = f
i.x = g
i.p = m
i.v = l
assert k.x.t.x.p.o.txt == "f"