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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.q: A = None
        self.u: C = None
        self.y: E = None
        self.x: E = None
        self.r: G = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: H = None
        self.r: G = None
        self.q: H = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.q: A = None
        self.u: C = None
        self.y: E = None
        self.x: E = None
        self.r: G = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: H = None
        self.r: G = None
        self.q: H = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

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