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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: D = None
        self.t: B = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.y: D = None
        self.txt = txt

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

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

h.s = g
g.w = h
g.r = h
k.r = g
k.t = g
k.y = g
k.q = a
a.o = i
a.p = g
j.v = a
j.y = a
j.q = n
n.t = h
n.u = i
n.o = j
n.p = j
n.s = d
i.v = a
i.y = a
i.q = l
d.r = g
d.t = g
d.y = g
d.q = a
l.t = h
l.u = j
l.p = j
l.o = i
l.s = k
assert k.t.r.s.r.s.r.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: D = None
        self.t: B = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.y: D = None
        self.txt = txt

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

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

h.s = g
g.w = h
g.r = h
k.r = g
k.t = g
k.y = g
k.q = a
a.o = i
a.p = g
j.v = a
j.y = a
j.q = n
n.t = h
n.u = i
n.o = j
n.p = j
n.s = d
i.v = a
i.y = a
i.q = l
d.r = g
d.t = g
d.y = g
d.q = a
l.t = h
l.u = j
l.p = j
l.o = i
l.s = k
assert k.t.r.s.r.s.r.s.r.txt == "h"