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

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

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

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

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

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

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

i.p = m
i.y = h
i.x = h
i.t = k
i.q = a
m.z = h
m.x = h
m.t = i
m.u = g
m.r = k
k.t = l
k.s = f
g.z = m
l.s = i
h.t = g
h.p = g
h.y = l
h.v = k
h.z = k
h.x = d
d.p = a
d.y = h
d.x = h
d.t = k
d.q = m
a.z = h
a.x = h
a.t = n
a.u = g
a.r = k
f.s = d
n.p = a
n.y = h
n.x = h
n.t = k
n.q = m
assert l.s.t.s.s.t.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: F = None
        self.t: C = None
        self.q: B = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

i.p = m
i.y = h
i.x = h
i.t = k
i.q = a
m.z = h
m.x = h
m.t = i
m.u = g
m.r = k
k.t = l
k.s = f
g.z = m
l.s = i
h.t = g
h.p = g
h.y = l
h.v = k
h.z = k
h.x = d
d.p = a
d.y = h
d.x = h
d.t = k
d.q = m
a.z = h
a.x = h
a.t = n
a.u = g
a.r = k
f.s = d
n.p = a
n.y = h
n.x = h
n.t = k
n.q = m
assert l.s.t.s.s.t.s.s.txt == "d"