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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

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

n.y = b
g.p = d
g.r = d
g.w = k
g.v = l
g.z = c
g.u = j
g.q = h
g.x = b
k.r = j
k.u = j
k.p = c
k.t = c
k.x = b
k.s = g
k.z = l
k.w = d
l.z = j
l.x = b
b.v = c
d.x = h
c.y = b
c.t = b
c.z = j
c.o = l
c.x = d
c.p = n
h.z = b
h.y = l
h.q = l
h.x = d
h.w = n
h.v = g
j.s = c
j.q = c
j.t = d
j.r = k
j.u = l
j.v = h
assert l.x.v.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

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

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