class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: D = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: G = None
        self.u: I = None
        self.o: E = None
        self.r: I = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: D = None
        self.z: B = None
        self.y: C = None
        self.o: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: A = None
        self.u: D = None
        self.y: C = None
        self.z: H = None
        self.s: H = None
        self.r: G = None
        self.t: D = None
        self.txt = txt

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

a.x = k
a.y = l
a.r = g
g.w = i
g.r = h
c.p = i
c.q = j
c.u = m
c.r = m
c.o = k
c.z = k
l.q = g
l.t = j
k.p = h
k.t = l
h.s = k
h.u = l
h.z = g
h.o = g
h.y = c
j.x = h
j.r = l
i.r = j
m.p = i
m.z = i
m.s = i
m.x = a
m.u = l
m.t = l
m.y = c
m.r = j
assert i.r.x.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: D = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: G = None
        self.u: I = None
        self.o: E = None
        self.r: I = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: D = None
        self.z: B = None
        self.y: C = None
        self.o: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: A = None
        self.u: D = None
        self.y: C = None
        self.z: H = None
        self.s: H = None
        self.r: G = None
        self.t: D = None
        self.txt = txt

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

a.x = k
a.y = l
a.r = g
g.w = i
g.r = h
c.p = i
c.q = j
c.u = m
c.r = m
c.o = k
c.z = k
l.q = g
l.t = j
k.p = h
k.t = l
h.s = k
h.u = l
h.z = g
h.o = g
h.y = c
j.x = h
j.r = l
i.r = j
m.p = i
m.z = i
m.s = i
m.x = a
m.u = l
m.t = l
m.y = c
m.r = j
assert i.r.x.u.q.txt == "g"