class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: B = None
        self.y: F = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: F = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

d.o = c
d.v = m
d.s = m
d.y = k
d.z = h
m.s = a
m.z = k
m.w = d
m.o = h
b.p = h
b.v = h
b.u = f
b.o = k
b.x = c
a.p = b
n.r = c
n.v = m
k.z = f
h.p = b
h.v = b
h.u = d
h.o = k
h.x = c
f.o = n
f.v = m
f.s = m
f.y = k
f.z = b
e.r = n
e.v = m
c.r = e
c.v = m
assert k.z.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: B = None
        self.y: F = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: F = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

d.o = c
d.v = m
d.s = m
d.y = k
d.z = h
m.s = a
m.z = k
m.w = d
m.o = h
b.p = h
b.v = h
b.u = f
b.o = k
b.x = c
a.p = b
n.r = c
n.v = m
k.z = f
h.p = b
h.v = b
h.u = d
h.o = k
h.x = c
f.o = n
f.v = m
f.s = m
f.y = k
f.z = b
e.r = n
e.v = m
c.r = e
c.v = m
assert k.z.z.x.txt == "c"