class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: B = None
        self.q: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.y: H = None
        self.p: G = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

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

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

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

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

k = A("k")
a = B("a")
f = C("f")
m = D("m")
d = E("d")
i = F("i")
b = G("b")
h = H("h")
e = G("e")

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: B = None
        self.q: E = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.y: H = None
        self.p: G = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

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

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

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

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

k = A("k")
a = B("a")
f = C("f")
m = D("m")
d = E("d")
i = F("i")
b = G("b")
h = H("h")
e = G("e")

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