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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: B = None
        self.q: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: D = None
        self.u: A = None
        self.t: D = None
        self.w: F = None
        self.s: D = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: B = None
        self.q: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: D = None
        self.u: A = None
        self.t: D = None
        self.w: F = None
        self.s: D = None
        self.p: F = None
        self.txt = txt

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

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

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