class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: D = None
        self.u: C = None
        self.t: B = None
        self.q: H = None
        self.z: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

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

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