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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: A = None
        self.p: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.s: H = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: A = None
        self.p: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.s: H = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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