class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: H = None
        self.p: A = None
        self.u: G = None
        self.y: F = None
        self.z: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.v: B = None
        self.t: G = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: F = None
        self.o: G = None
        self.z: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: H = None
        self.p: A = None
        self.u: G = None
        self.y: F = None
        self.z: E = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.v: B = None
        self.t: G = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: F = None
        self.o: G = None
        self.z: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

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

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