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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.v: H = None
        self.p: D = None
        self.s: D = None
        self.y: G = None
        self.w: G = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.s: H = None
        self.u: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: D = None
        self.v: B = None
        self.t: G = None
        self.o: E = None
        self.s: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.v: H = None
        self.p: D = None
        self.s: D = None
        self.y: G = None
        self.w: G = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.s: H = None
        self.u: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: D = None
        self.v: B = None
        self.t: G = None
        self.o: E = None
        self.s: C = None
        self.txt = txt

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

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