class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: B = None
        self.x: E = None
        self.u: B = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.w: F = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.w: F = None
        self.u: B = None
        self.txt = txt

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

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

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

c.z = i
c.y = b
c.x = k
c.u = d
c.o = e
b.t = d
b.z = d
b.u = k
b.y = k
f.u = b
e.t = b
e.u = b
e.o = k
e.w = i
k.s = i
k.o = h
k.t = c
k.p = e
i.q = e
i.o = c
h.u = b
d.t = b
d.z = b
d.u = k
d.y = k
a.u = b
assert k.p.w.o.x.txt == "k"