class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: H = None
        self.w: D = None
        self.t: H = None
        self.s: G = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: F = None
        self.r: G = None
        self.p: E = None
        self.x: G = None
        self.v: A = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: A = None
        self.q: I = None
        self.v: H = None
        self.r: J = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: B = None
        self.w: F = None
        self.y: A = None
        self.x: A = None
        self.z: D = None
        self.r: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: F = None
        self.r: G = None
        self.p: E = None
        self.x: G = None
        self.v: A = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: A = None
        self.q: I = None
        self.v: H = None
        self.r: J = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: B = None
        self.w: F = None
        self.y: A = None
        self.x: A = None
        self.z: D = None
        self.r: F = None
        self.txt = txt

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

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