class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

k = A("k")
f = B("f")
h = C("h")
n = D("n")
e = E("e")
a = F("a")

k.o = h
k.x = h
k.z = f
f.z = h
h.o = k
h.t = a
h.r = e
h.u = e
n.o = k
n.u = f
n.v = a
e.u = k
e.s = f
e.z = h
a.v = n
a.u = n
a.z = k
assert k.x.r.z.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

k = A("k")
f = B("f")
h = C("h")
n = D("n")
e = E("e")
a = F("a")

k.o = h
k.x = h
k.z = f
f.z = h
h.o = k
h.t = a
h.r = e
h.u = e
n.o = k
n.u = f
n.v = a
e.u = k
e.s = f
e.z = h
a.v = n
a.u = n
a.z = k
assert k.x.r.z.o.o.txt == "h"