class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.z: G = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: B = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: E = None
        self.r: G = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: D = None
        self.y: F = None
        self.txt = txt

k = A("k")
h = B("h")
n = C("n")
l = D("l")
b = E("b")
i = F("i")
d = G("d")
m = E("m")

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: B = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: E = None
        self.r: G = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: D = None
        self.y: F = None
        self.txt = txt

k = A("k")
h = B("h")
n = C("n")
l = D("l")
b = E("b")
i = F("i")
d = G("d")
m = E("m")

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