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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: B = None
        self.u: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: C = None
        self.w: A = None
        self.txt = txt

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

e.y = b
m.q = g
d.u = m
l.u = b
l.v = b
l.t = i
l.z = g
l.r = g
b.w = c
b.u = c
b.t = m
g.t = b
i.t = b
i.v = b
i.q = c
i.r = c
i.z = m
i.p = m
i.u = g
c.q = g
c.p = d
c.w = e
assert c.w.y.u.p.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: B = None
        self.u: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: C = None
        self.w: A = None
        self.txt = txt

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

e.y = b
m.q = g
d.u = m
l.u = b
l.v = b
l.t = i
l.z = g
l.r = g
b.w = c
b.u = c
b.t = m
g.t = b
i.t = b
i.v = b
i.q = c
i.r = c
i.z = m
i.p = m
i.u = g
c.q = g
c.p = d
c.w = e
assert c.w.y.u.p.u.q.txt == "g"