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

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

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

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

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

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

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

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

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

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

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

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

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

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

h.r = n
h.y = n
h.z = c
h.x = c
h.t = a
h.p = i
m.o = a
m.s = h
a.w = b
a.p = m
a.o = m
b.o = n
b.w = a
g.o = b
g.u = b
g.q = e
g.y = c
g.p = c
g.s = i
c.s = m
c.r = a
c.y = n
c.o = g
c.t = e
e.o = i
e.s = i
e.q = d
e.y = c
e.p = c
e.u = b
i.o = h
i.w = a
d.o = i
d.q = g
d.y = c
d.p = c
d.u = b
d.s = b
n.r = h
n.y = h
n.z = c
n.x = c
n.t = a
n.p = i
assert m.o.o.s.t.p.s.t.o.o.txt == "a"