class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: F = None
        self.u: A = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.txt = txt

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

e.w = g
e.o = n
a.p = g
a.u = e
a.z = k
f.x = n
f.u = n
f.s = c
f.v = d
h.t = c
g.v = h
g.z = h
g.x = e
g.s = a
g.u = c
c.w = i
c.o = i
n.w = g
n.o = e
d.p = g
d.u = e
d.z = k
k.t = c
i.x = n
i.s = c
i.u = e
i.v = d
assert f.s.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: F = None
        self.u: A = None
        self.v: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.txt = txt

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

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