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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: I = None
        self.v: G = None
        self.q: F = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: H = None
        self.s: H = None
        self.z: F = None
        self.o: G = None
        self.u: H = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: E = None
        self.o: E = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: I = None
        self.r: B = None
        self.t: A = None
        self.o: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: I = None
        self.v: G = None
        self.q: F = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: H = None
        self.s: H = None
        self.z: F = None
        self.o: G = None
        self.u: H = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: E = None
        self.o: E = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: I = None
        self.r: B = None
        self.t: A = None
        self.o: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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