class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: J = None
        self.x: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: E = None
        self.p: D = None
        self.u: F = None
        self.r: A = None
        self.z: F = None
        self.o: D = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: H = None
        self.r: G = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: A = None
        self.t: I = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: F = None
        self.z: B = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: J = None
        self.x: G = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: E = None
        self.p: D = None
        self.u: F = None
        self.r: A = None
        self.z: F = None
        self.o: D = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: H = None
        self.r: G = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: A = None
        self.t: I = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: F = None
        self.z: B = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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