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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.q: D = None
        self.w: I = None
        self.x: H = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.t: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: H = None
        self.z: F = None
        self.s: H = None
        self.x: H = None
        self.r: D = None
        self.w: B = None
        self.t: H = None
        self.q: E = None
        self.txt = txt

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

c.o = i
d.s = g
m.p = d
e.o = h
e.w = b
g.r = c
b.u = m
b.v = g
b.s = g
b.q = e
b.w = h
b.x = a
i.q = b
i.o = g
i.t = h
a.x = g
h.u = a
h.v = a
h.s = a
h.x = a
h.t = a
h.z = b
h.r = e
h.w = d
h.q = g
assert a.x.r.o.o.r.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.q: D = None
        self.w: I = None
        self.x: H = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.t: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: H = None
        self.z: F = None
        self.s: H = None
        self.x: H = None
        self.r: D = None
        self.w: B = None
        self.t: H = None
        self.q: E = None
        self.txt = txt

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

c.o = i
d.s = g
m.p = d
e.o = h
e.w = b
g.r = c
b.u = m
b.v = g
b.s = g
b.q = e
b.w = h
b.x = a
i.q = b
i.o = g
i.t = h
a.x = g
h.u = a
h.v = a
h.s = a
h.x = a
h.t = a
h.z = b
h.r = e
h.w = d
h.q = g
assert a.x.r.o.o.r.o.q.txt == "b"