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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: C = None
        self.o: A = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: C = None
        self.o: A = None
        self.x: G = None
        self.txt = txt

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

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

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

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