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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: B = None
        self.u: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: F = None
        self.v: B = None
        self.r: D = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: H = None
        self.s: E = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: H = None
        self.u: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: B = None
        self.u: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: F = None
        self.v: B = None
        self.r: D = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: H = None
        self.s: E = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: H = None
        self.u: H = None
        self.txt = txt

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

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

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