class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: A = None
        self.r: B = None
        self.s: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: A = None
        self.r: B = None
        self.s: D = None
        self.v: E = None
        self.txt = txt

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

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

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