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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.p: D = None
        self.s: B = None
        self.v: H = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: G = None
        self.r: H = None
        self.t: G = None
        self.o: A = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.y: A = None
        self.x: C = None
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.s: A = None
        self.v: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: H = None
        self.r: C = None
        self.t: D = None
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.p: D = None
        self.s: B = None
        self.v: H = None
        self.u: B = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: G = None
        self.r: H = None
        self.t: G = None
        self.o: A = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.y: A = None
        self.x: C = None
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.s: A = None
        self.v: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: H = None
        self.r: C = None
        self.t: D = None
        self.v: F = None
        self.txt = txt

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

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