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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: A = None
        self.o: A = None
        self.p: F = None
        self.t: A = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: A = None
        self.o: A = None
        self.p: F = None
        self.t: A = None
        self.y: F = None
        self.txt = txt

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

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

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