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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: B = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: C = None
        self.t: G = None
        self.y: A = None
        self.q: D = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: F = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: B = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: C = None
        self.t: G = None
        self.y: A = None
        self.q: D = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: F = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

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

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