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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: A = None
        self.y: H = None
        self.u: C = None
        self.q: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: I = None
        self.o: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: C = None
        self.p: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: A = None
        self.y: H = None
        self.u: C = None
        self.q: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: I = None
        self.o: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: C = None
        self.p: I = None
        self.txt = txt

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

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

a.r = c
c.r = e
c.q = e
c.s = a
c.y = m
c.u = i
i.u = j
i.o = j
i.y = g
j.v = m
j.z = i
h.v = e
h.q = k
h.o = k
g.v = h
g.r = m
e.p = j
m.y = k
m.p = k
m.q = i
k.u = i
k.v = i
k.x = c
k.y = c
k.q = c
k.t = e
k.p = a
assert j.z.y.r.p.y.txt == "c"