class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: H = None
        self.r: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: D = None
        self.s: I = None
        self.y: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: D = None
        self.s: I = None
        self.y: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: A = None
        self.txt = txt

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

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