class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: I = None
        self.t: C = None
        self.w: I = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: C = None
        self.t: H = None
        self.p: H = None
        self.y: H = None
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: F = None
        self.t: A = None
        self.v: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: C = None
        self.t: H = None
        self.p: H = None
        self.y: H = None
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: F = None
        self.t: A = None
        self.v: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.y: G = None
        self.txt = txt

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

f.p = e
f.r = e
f.o = h
f.w = h
f.t = g
i.u = f
i.s = g
i.t = m
i.p = m
i.y = m
i.w = l
i.o = b
g.y = h
g.x = n
n.r = b
n.v = g
n.w = g
n.s = h
n.u = e
n.p = m
l.w = f
l.t = f
l.u = b
l.v = e
b.s = l
e.y = h
m.t = n
m.p = b
h.r = l
h.w = l
h.y = e
assert g.y.r.t.txt == "f"