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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: D = None
        self.p: C = None
        self.q: F = None
        self.r: H = None
        self.w: B = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

d.y = e
d.r = e
d.u = m
b.v = a
b.r = a
b.z = l
b.y = l
b.u = n
b.o = m
b.q = g
a.r = b
a.o = m
l.q = b
l.x = e
e.s = l
e.x = l
e.y = l
e.p = n
m.o = n
m.v = a
m.u = l
m.r = d
m.s = b
n.s = i
n.r = i
n.o = l
n.p = a
n.q = m
n.w = b
n.z = b
g.z = c
c.y = e
c.r = e
c.u = m
i.z = c
assert m.o.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: D = None
        self.p: C = None
        self.q: F = None
        self.r: H = None
        self.w: B = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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