class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: B = None
        self.x: J = None
        self.t: J = None
        self.q: E = None
        self.s: C = None
        self.z: D = None
        self.o: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: B = None
        self.q: H = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.w: E = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.v: C = None
        self.y: J = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: B = None
        self.q: H = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.w: E = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.v: C = None
        self.y: J = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: A = None
        self.txt = txt

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

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