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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.t: I = None
        self.q: B = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: H = None
        self.q: C = None
        self.z: H = None
        self.u: G = None
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.t: I = None
        self.q: B = None
        self.w: B = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: H = None
        self.q: C = None
        self.z: H = None
        self.u: G = None
        self.t: D = None
        self.txt = txt

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

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