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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.x: C = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: H = None
        self.o: D = None
        self.u: H = None
        self.r: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: E = None
        self.q: F = None
        self.y: E = None
        self.s: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.x: C = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: H = None
        self.o: D = None
        self.u: H = None
        self.r: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: E = None
        self.q: F = None
        self.y: E = None
        self.s: H = None
        self.txt = txt

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

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

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