class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.t: C = None
        self.o: G = None
        self.r: I = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.r: G = None
        self.u: D = None
        self.o: I = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.w: F = None
        self.p: F = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: G = None
        self.w: E = None
        self.q: E = None
        self.y: C = None
        self.r: E = None
        self.s: G = None
        self.p: D = None
        self.txt = txt

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

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

a.q = c
a.x = c
a.t = b
a.o = f
a.r = k
a.p = i
e.y = i
e.t = l
e.s = l
b.w = i
b.u = i
b.t = i
b.p = f
b.r = f
b.o = k
i.q = f
c.q = k
c.x = i
c.z = b
m.z = e
m.y = i
m.w = g
m.p = g
m.u = f
f.o = a
f.r = e
l.v = g
l.o = f
l.s = f
l.w = c
l.q = c
l.r = c
l.y = b
l.p = i
k.q = e
k.p = e
k.r = i
k.x = i
k.y = c
g.z = e
g.y = i
g.w = m
g.p = m
g.u = f
assert i.q.r.s.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.t: C = None
        self.o: G = None
        self.r: I = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.r: G = None
        self.u: D = None
        self.o: I = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: D = None
        self.w: F = None
        self.p: F = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: G = None
        self.w: E = None
        self.q: E = None
        self.y: C = None
        self.r: E = None
        self.s: G = None
        self.p: D = None
        self.txt = txt

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

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

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