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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: G = None
        self.o: B = None
        self.r: H = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: C = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.r: B = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: G = None
        self.o: B = None
        self.r: H = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: C = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.r: B = None
        self.p: A = None
        self.txt = txt

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

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