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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: A = None
        self.x: E = None
        self.q: D = None
        self.p: G = None
        self.y: G = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: G = None
        self.r: B = None
        self.t: A = None
        self.s: B = None
        self.p: D = None
        self.q: C = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: A = None
        self.x: E = None
        self.q: D = None
        self.p: G = None
        self.y: G = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: G = None
        self.r: B = None
        self.t: A = None
        self.s: B = None
        self.p: D = None
        self.q: C = None
        self.x: F = None
        self.txt = txt

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

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