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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.z: I = None
        self.u: D = None
        self.q: H = None
        self.s: H = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.w: H = None
        self.z: E = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.z: I = None
        self.u: D = None
        self.q: H = None
        self.s: H = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.w: H = None
        self.z: E = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.txt = txt

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

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

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