class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: G = None
        self.o: F = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.o: D = None
        self.u: B = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: A = None
        self.t: C = None
        self.r: C = None
        self.o: G = None
        self.y: C = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: D = None
        self.y: C = None
        self.v: E = None
        self.r: C = None
        self.q: D = None
        self.u: F = None
        self.txt = txt

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

g = A("g")
c = B("c")
h = C("h")
e = D("e")
f = E("f")
k = F("k")
d = G("d")
i = H("i")

g.u = i
g.q = d
g.o = k
g.t = h
g.z = c
c.x = h
c.v = g
h.w = f
h.v = c
h.u = c
h.o = e
h.r = g
e.q = i
e.o = g
e.p = k
f.v = c
f.s = g
f.t = h
f.r = h
f.y = h
f.o = d
f.w = d
k.p = c
d.w = i
d.z = e
d.q = e
d.y = h
d.r = h
d.v = f
d.u = k
i.v = d
assert i.v.q.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: G = None
        self.o: F = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.o: D = None
        self.u: B = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: A = None
        self.t: C = None
        self.r: C = None
        self.o: G = None
        self.y: C = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: D = None
        self.y: C = None
        self.v: E = None
        self.r: C = None
        self.q: D = None
        self.u: F = None
        self.txt = txt

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

g = A("g")
c = B("c")
h = C("h")
e = D("e")
f = E("f")
k = F("k")
d = G("d")
i = H("i")

g.u = i
g.q = d
g.o = k
g.t = h
g.z = c
c.x = h
c.v = g
h.w = f
h.v = c
h.u = c
h.o = e
h.r = g
e.q = i
e.o = g
e.p = k
f.v = c
f.s = g
f.t = h
f.r = h
f.y = h
f.o = d
f.w = d
k.p = c
d.w = i
d.z = e
d.q = e
d.y = h
d.r = h
d.v = f
d.u = k
i.v = d
assert i.v.q.p.p.txt == "c"