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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.w: I = None
        self.u: H = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

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

f = A("f")
k = B("k")
h = C("h")
n = D("n")
m = E("m")
c = F("c")
e = G("e")
j = H("j")
a = I("a")

f.w = h
k.o = e
h.s = k
n.w = h
n.v = m
m.y = e
m.x = e
m.w = a
m.u = j
m.p = n
c.p = j
e.t = m
e.r = n
e.s = a
j.z = a
j.s = e
a.o = e
assert h.s.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.w: I = None
        self.u: H = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

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

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

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

f = A("f")
k = B("k")
h = C("h")
n = D("n")
m = E("m")
c = F("c")
e = G("e")
j = H("j")
a = I("a")

f.w = h
k.o = e
h.s = k
n.w = h
n.v = m
m.y = e
m.x = e
m.w = a
m.u = j
m.p = n
c.p = j
e.t = m
e.r = n
e.s = a
j.z = a
j.s = e
a.o = e
assert h.s.o.r.txt == "n"