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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: E = None
        self.z: C = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.x: C = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

n = A("n")
c = B("c")
f = C("f")
i = D("i")
h = E("h")
m = F("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: E = None
        self.z: C = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.x: C = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: C = None
        self.y: C = None
        self.txt = txt

n = A("n")
c = B("c")
f = C("f")
i = D("i")
h = E("h")
m = F("m")

n.o = f
n.v = h
n.z = h
n.x = m
n.p = i
n.u = i
c.t = i
c.s = n
c.y = n
c.o = n
c.z = f
c.w = m
f.p = n
f.u = n
f.t = h
i.v = f
i.z = f
i.q = h
i.r = h
h.s = n
h.w = n
h.y = c
h.x = f
h.q = m
m.z = f
m.r = f
m.y = f
assert c.z.t.x.t.txt == "h"