class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: G = None
        self.t: F = None
        self.y: B = None
        self.r: C = None
        self.w: I = None
        self.s: B = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: H = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.z: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: H = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.z: I = None
        self.txt = txt

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

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

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

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