class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: I = None
        self.y: F = None
        self.r: G = None
        self.u: C = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: F = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: G = None
        self.z: C = None
        self.s: I = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: F = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: F = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: G = None
        self.z: C = None
        self.s: I = None
        self.txt = txt

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

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

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

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

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