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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

l = A("l")
b = B("b")
n = C("n")
a = D("a")
g = E("g")
d = F("d")
j = G("j")
e = H("e")
i = C("i")

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: H = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

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

l = A("l")
b = B("b")
n = C("n")
a = D("a")
g = E("g")
d = F("d")
j = G("j")
e = H("e")
i = C("i")

l.z = b
l.s = n
b.w = l
b.q = e
b.t = g
n.r = l
n.w = e
n.s = i
a.z = e
g.x = d
g.q = a
g.p = a
d.r = b
d.o = e
d.x = g
d.z = a
j.q = n
j.p = n
j.w = n
j.y = g
e.z = d
i.r = l
i.w = e
i.s = n
assert n.s.w.z.z.z.z.z.z.z.txt == "d"