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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: H = None
        self.x: B = None
        self.r: A = None
        self.p: F = None
        self.o: A = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: E = None
        self.txt = txt

l = A("l")
g = B("g")
b = C("b")
c = D("c")
e = E("e")
k = F("k")
h = G("h")
n = H("n")

l.q = n
g.p = n
g.x = b
b.v = h
c.t = l
c.r = l
c.o = l
c.w = n
c.x = g
c.p = k
c.s = e
e.r = n
e.s = n
e.q = l
k.x = e
k.r = b
k.u = g
k.y = n
k.z = h
h.s = n
n.o = h
n.s = e
assert k.z.s.o.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: H = None
        self.x: B = None
        self.r: A = None
        self.p: F = None
        self.o: A = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: E = None
        self.txt = txt

l = A("l")
g = B("g")
b = C("b")
c = D("c")
e = E("e")
k = F("k")
h = G("h")
n = H("n")

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