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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.u: G = None
        self.r: B = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: C = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: G = None
        self.t: H = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.y: C = None
        self.o: A = None
        self.u: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.u: G = None
        self.r: B = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: C = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: G = None
        self.t: H = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.y: C = None
        self.o: A = None
        self.u: F = None
        self.txt = txt

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

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