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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.o: H = None
        self.t: D = None
        self.txt = txt

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

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

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

h.u = n
h.o = n
h.x = i
h.q = i
h.z = c
h.s = g
f.r = h
c.y = a
g.z = c
j.y = f
a.s = n
a.u = j
a.r = i
k.x = c
k.z = c
k.o = l
k.t = g
l.q = k
n.x = l
n.o = g
i.u = n
i.o = n
i.x = h
i.q = h
i.z = c
i.s = g
assert j.y.r.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: A = None
        self.q: A = None
        self.o: I = None
        self.z: C = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.o: H = None
        self.t: D = None
        self.txt = txt

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

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

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

h.u = n
h.o = n
h.x = i
h.q = i
h.z = c
h.s = g
f.r = h
c.y = a
g.z = c
j.y = f
a.s = n
a.u = j
a.r = i
k.x = c
k.z = c
k.o = l
k.t = g
l.q = k
n.x = l
n.o = g
i.u = n
i.o = n
i.x = h
i.q = h
i.z = c
i.s = g
assert j.y.r.u.o.txt == "g"