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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: C = None
        self.s: I = None
        self.q: F = None
        self.w: I = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: B = None
        self.v: A = None
        self.o: I = None
        self.w: I = None
        self.x: B = None
        self.s: B = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.x: D = None
        self.z: I = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: C = None
        self.r: F = None
        self.v: I = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: C = None
        self.s: I = None
        self.q: F = None
        self.w: I = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: B = None
        self.v: A = None
        self.o: I = None
        self.w: I = None
        self.x: B = None
        self.s: B = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.x: D = None
        self.z: I = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: C = None
        self.r: F = None
        self.v: I = None
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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