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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: H = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: H = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: H = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: H = None
        self.s: A = None
        self.txt = txt

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

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

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

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

c.r = j
j.q = h
j.x = h
i.z = j
i.u = n
i.x = h
h.w = i
h.p = j
l.x = b
l.v = n
l.s = c
g.w = c
g.u = j
g.q = j
b.y = g
b.p = g
n.w = h
assert c.r.x.w.u.w.w.txt == "i"