class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: H = None
        self.x: J = None
        self.q: F = None
        self.u: G = None
        self.o: H = None
        self.w: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: J = None
        self.r: E = None
        self.t: A = None
        self.o: B = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: I = None
        self.z: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.v: A = None
        self.y: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: J = None
        self.r: E = None
        self.t: A = None
        self.o: B = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: I = None
        self.z: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.v: A = None
        self.y: E = None
        self.txt = txt

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

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