class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: B = None
        self.r: G = None
        self.z: H = None
        self.w: F = None
        self.p: H = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: D = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: D = None
        self.u: H = None
        self.z: B = None
        self.o: F = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: G = None
        self.x: G = None
        self.w: G = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: A = None
        self.v: F = None
        self.o: E = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

h = A("h")
m = B("m")
c = C("c")
b = D("b")
g = E("g")
e = F("e")
f = G("f")
i = H("i")
n = C("n")

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: D = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: D = None
        self.u: H = None
        self.z: B = None
        self.o: F = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: G = None
        self.x: G = None
        self.w: G = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: A = None
        self.v: F = None
        self.o: E = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

h = A("h")
m = B("m")
c = C("c")
b = D("b")
g = E("g")
e = F("e")
f = G("f")
i = H("i")
n = C("n")

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