class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: F = None
        self.r: J = None
        self.y: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.o: G = None
        self.x: A = None
        self.u: D = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.v: H = None
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: F = None
        self.o: A = None
        self.r: C = None
        self.q: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.o: G = None
        self.x: A = None
        self.u: D = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.v: H = None
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.y: F = None
        self.o: A = None
        self.r: C = None
        self.q: I = None
        self.txt = txt

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

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

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

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