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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: H = None
        self.w: C = None
        self.s: H = None
        self.y: H = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

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

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

h = A("h")
g = B("g")
c = C("c")
d = D("d")
m = E("m")
i = F("i")
n = G("n")
l = H("l")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.y: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: H = None
        self.w: C = None
        self.s: H = None
        self.y: H = None
        self.z: A = None
        self.x: D = None
        self.txt = txt

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

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

h = A("h")
g = B("g")
c = C("c")
d = D("d")
m = E("m")
i = F("i")
n = G("n")
l = H("l")

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