class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.y: F = None
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: C = None
        self.z: H = None
        self.p: H = None
        self.y: G = None
        self.x: I = None
        self.w: I = None
        self.t: I = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: E = None
        self.w: E = None
        self.y: E = None
        self.v: A = None
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: C = None
        self.x: I = None
        self.w: F = None
        self.o: G = None
        self.y: E = None
        self.t: C = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

c = A("c")
h = B("h")
k = C("k")
f = D("f")
i = E("i")
a = F("a")
m = G("m")
b = H("b")
g = I("g")

c.z = f
c.o = i
c.p = i
c.y = a
h.z = c
h.p = c
h.u = b
k.o = m
f.q = g
f.z = g
f.y = k
i.u = b
i.z = b
i.p = b
i.v = k
i.s = k
i.y = m
i.x = g
i.w = g
i.t = g
a.x = m
a.o = i
a.w = i
a.y = i
a.v = c
a.p = b
m.z = g
m.o = f
b.z = a
b.w = a
b.r = k
b.t = k
b.x = g
b.o = m
b.y = i
b.p = i
b.u = i
g.s = h
assert k.o.z.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.y: F = None
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: C = None
        self.z: H = None
        self.p: H = None
        self.y: G = None
        self.x: I = None
        self.w: I = None
        self.t: I = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: E = None
        self.w: E = None
        self.y: E = None
        self.v: A = None
        self.p: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: C = None
        self.x: I = None
        self.w: F = None
        self.o: G = None
        self.y: E = None
        self.t: C = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

c = A("c")
h = B("h")
k = C("k")
f = D("f")
i = E("i")
a = F("a")
m = G("m")
b = H("b")
g = I("g")

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