class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: B = None
        self.r: C = None
        self.p: I = None
        self.t: H = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: C = None
        self.q: I = None
        self.v: H = None
        self.s: F = None
        self.x: G = None
        self.y: G = None
        self.u: A = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: E = None
        self.u: H = None
        self.q: H = None
        self.z: E = None
        self.r: B = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: B = None
        self.s: E = None
        self.o: A = None
        self.q: C = None
        self.t: I = None
        self.y: I = None
        self.u: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.q: G = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: C = None
        self.q: I = None
        self.v: H = None
        self.s: F = None
        self.x: G = None
        self.y: G = None
        self.u: A = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: E = None
        self.u: H = None
        self.q: H = None
        self.z: E = None
        self.r: B = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: B = None
        self.s: E = None
        self.o: A = None
        self.q: C = None
        self.t: I = None
        self.y: I = None
        self.u: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.q: G = None
        self.t: C = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: B = None
        self.txt = txt

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

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