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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: H = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: D = None
        self.x: H = None
        self.v: G = None
        self.o: A = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: C = None
        self.v: C = None
        self.o: G = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: A = None
        self.z: A = None
        self.x: C = None
        self.q: D = None
        self.o: A = None
        self.u: C = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: H = None
        self.q: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: D = None
        self.x: H = None
        self.v: G = None
        self.o: A = None
        self.q: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.t: C = None
        self.v: C = None
        self.o: G = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: A = None
        self.z: A = None
        self.x: C = None
        self.q: D = None
        self.o: A = None
        self.u: C = None
        self.w: F = None
        self.txt = txt

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

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