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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: G = None
        self.y: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: F = None
        self.v: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: G = None
        self.y: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: F = None
        self.v: B = None
        self.txt = txt

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

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