class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: F = None
        self.v: I = None
        self.z: F = None
        self.p: D = None
        self.w: C = None
        self.q: E = None
        self.u: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: H = None
        self.q: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: A = None
        self.u: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: H = None
        self.q: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: A = None
        self.u: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: A = None
        self.p: B = None
        self.txt = txt

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

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

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