class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: G = None
        self.z: E = None
        self.v: D = None
        self.o: D = None
        self.x: H = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: D = None
        self.q: A = None
        self.y: F = None
        self.o: E = None
        self.v: D = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: D = None
        self.o: H = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

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

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

h = A("h")
g = B("g")
c = C("c")
i = D("i")
m = E("m")
k = F("k")
d = G("d")
l = H("l")

h.u = g
h.p = d
h.z = m
h.v = i
h.o = i
h.x = l
h.q = l
g.w = d
g.p = h
g.y = h
g.t = m
c.t = d
c.x = d
c.r = i
c.v = i
c.q = h
c.y = k
c.o = m
i.t = k
i.x = d
m.x = l
m.o = l
m.v = i
m.w = h
m.q = h
k.z = g
k.p = d
k.u = d
k.r = c
d.w = k
l.q = d
assert g.w.w.u.w.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: G = None
        self.z: E = None
        self.v: D = None
        self.o: D = None
        self.x: H = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: D = None
        self.q: A = None
        self.y: F = None
        self.o: E = None
        self.v: D = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: D = None
        self.o: H = None
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

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

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

h = A("h")
g = B("g")
c = C("c")
i = D("i")
m = E("m")
k = F("k")
d = G("d")
l = H("l")

h.u = g
h.p = d
h.z = m
h.v = i
h.o = i
h.x = l
h.q = l
g.w = d
g.p = h
g.y = h
g.t = m
c.t = d
c.x = d
c.r = i
c.v = i
c.q = h
c.y = k
c.o = m
i.t = k
i.x = d
m.x = l
m.o = l
m.v = i
m.w = h
m.q = h
k.z = g
k.p = d
k.u = d
k.r = c
d.w = k
l.q = d
assert g.w.w.u.w.z.w.txt == "d"