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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: A = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: H = None
        self.x: A = None
        self.t: G = None
        self.v: E = None
        self.w: C = None
        self.p: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: E = None
        self.x: I = None
        self.o: I = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

i.u = g
i.s = g
i.r = g
i.v = n
g.s = a
g.t = j
g.x = j
j.y = a
j.t = i
j.s = d
d.r = a
d.o = h
d.q = k
d.x = c
a.s = d
a.q = d
a.w = h
a.u = j
a.o = n
a.r = k
k.u = d
k.o = h
k.x = i
k.t = c
k.v = a
k.w = j
k.p = n
c.p = k
c.t = k
h.r = n
h.x = n
h.o = n
h.u = a
h.y = k
n.w = k
assert g.t.s.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: B = None
        self.r: B = None
        self.v: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: C = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: A = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: H = None
        self.x: A = None
        self.t: G = None
        self.v: E = None
        self.w: C = None
        self.p: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: E = None
        self.x: I = None
        self.o: I = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

i.u = g
i.s = g
i.r = g
i.v = n
g.s = a
g.t = j
g.x = j
j.y = a
j.t = i
j.s = d
d.r = a
d.o = h
d.q = k
d.x = c
a.s = d
a.q = d
a.w = h
a.u = j
a.o = n
a.r = k
k.u = d
k.o = h
k.x = i
k.t = c
k.v = a
k.w = j
k.p = n
c.p = k
c.t = k
h.r = n
h.x = n
h.o = n
h.u = a
h.y = k
n.w = k
assert g.t.s.r.u.txt == "j"