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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: G = None
        self.z: E = None
        self.v: A = None
        self.s: F = None
        self.o: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: A = None
        self.p: G = None
        self.s: H = None
        self.x: B = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: D = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: G = None
        self.z: E = None
        self.v: A = None
        self.s: F = None
        self.o: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: A = None
        self.p: G = None
        self.s: H = None
        self.x: B = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: D = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

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

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