class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: C = None
        self.z: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: H = None
        self.p: G = None
        self.x: F = None
        self.w: H = None
        self.y: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: G = None
        self.z: I = None
        self.o: A = None
        self.p: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: H = None
        self.p: G = None
        self.x: F = None
        self.w: H = None
        self.y: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: G = None
        self.z: I = None
        self.o: A = None
        self.p: A = None
        self.txt = txt

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

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