class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: I = None
        self.y: F = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.w: G = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: A = None
        self.q: E = None
        self.u: A = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: I = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: B = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: E = None
        self.x: I = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.w: G = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.t: A = None
        self.q: E = None
        self.u: A = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: I = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: B = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: E = None
        self.x: I = None
        self.p: F = None
        self.txt = txt

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

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

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

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