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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: F = None
        self.r: E = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: H = None
        self.txt = txt

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

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

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

n = A("n")
m = B("m")
b = C("b")
h = D("h")
a = E("a")
f = F("f")
g = G("g")
l = H("l")

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: F = None
        self.r: E = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: H = None
        self.txt = txt

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

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

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

n = A("n")
m = B("m")
b = C("b")
h = D("h")
a = E("a")
f = F("f")
g = G("g")
l = H("l")

n.v = h
n.s = h
n.u = h
n.z = m
n.x = f
n.r = g
n.p = a
m.q = h
b.q = h
b.t = f
b.r = a
b.w = a
h.w = g
h.z = f
h.u = b
a.q = b
a.v = l
f.q = g
f.y = h
f.r = h
g.z = l
l.z = f
l.p = a
l.x = h
assert n.u.w.z.x.u.w.q.t.txt == "f"