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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

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