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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

n.t = f
n.x = f
n.z = k
e.u = m
e.s = g
e.w = h
a.u = g
a.w = h
h.u = g
h.o = k
g.s = d
g.t = n
g.z = m
k.t = h
d.t = a
d.z = k
d.x = f
m.u = e
m.s = g
m.w = h
f.u = g
f.w = h
assert a.w.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

n.t = f
n.x = f
n.z = k
e.u = m
e.s = g
e.w = h
a.u = g
a.w = h
h.u = g
h.o = k
g.s = d
g.t = n
g.z = m
k.t = h
d.t = a
d.z = k
d.x = f
m.u = e
m.s = g
m.w = h
f.u = g
f.w = h
assert a.w.o.t.txt == "h"