class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: B = None
        self.y: C = None
        self.v: E = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: C = None
        self.p: H = None
        self.x: D = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.q: D = None
        self.o: F = None
        self.s: C = None
        self.z: H = None
        self.txt = txt

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

d = A("d")
g = B("g")
a = C("a")
c = D("c")
l = E("l")
j = F("j")
e = G("e")
n = H("n")
i = C("i")
h = D("h")

d.u = l
d.v = l
d.w = g
d.y = i
d.z = c
g.w = n
g.r = n
g.t = d
g.o = c
a.s = n
a.p = n
a.u = n
a.v = i
a.x = c
a.z = l
c.p = n
c.o = h
c.y = h
c.r = l
l.z = e
l.u = c
j.v = g
j.p = n
j.r = e
e.r = g
e.y = j
e.o = j
e.q = h
e.s = a
e.z = n
n.t = g
n.s = i
n.w = h
i.s = n
i.p = n
i.u = n
i.v = a
i.x = c
i.z = l
h.p = n
h.o = c
h.y = c
h.r = l
assert c.p.w.y.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: B = None
        self.y: C = None
        self.v: E = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: C = None
        self.p: H = None
        self.x: D = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.q: D = None
        self.o: F = None
        self.s: C = None
        self.z: H = None
        self.txt = txt

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

d = A("d")
g = B("g")
a = C("a")
c = D("c")
l = E("l")
j = F("j")
e = G("e")
n = H("n")
i = C("i")
h = D("h")

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