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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: B = None
        self.r: G = None
        self.s: D = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.z: G = None
        self.r: E = None
        self.v: A = None
        self.o: C = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: B = None
        self.r: G = None
        self.s: D = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.z: G = None
        self.r: E = None
        self.v: A = None
        self.o: C = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: E = None
        self.y: A = None
        self.txt = txt

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

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

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

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